Results 1 to 6 of 6
When you build an app in Windows, the "proper" location for it is:
C:\Program Files\Company\AppName
Or some variation of the above.
What is the "proper" or "recommended" location to build ...
- 02-24-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 59
The "Correct" location for an app in linux
When you build an app in Windows, the "proper" location for it is:
C:\Program Files\Company\AppName
Or some variation of the above.
What is the "proper" or "recommended" location to build custom apps in linux? I'm running debian if that matters
- 02-24-2011 #2
The Linux filesystem roughly adheres to the Filesystem Hierarchy Standard:
Filesystem Hierarchy Standard
According to the standard, independently-installed software should generally be placed in the appropriate /usr/local subdirectories (/usr/local/bin for the executables, /usr/local/include for new library headers, etc.).
/opt used to be popular for packages (e.g. /opt/mypackage/bin, etc.), but this has generally fallen out of favour. In particular, using /opt means that standard utilities generally won't work, as each subdirectory of /opt can be organized in any fashion, as opposed to the standardized format of /usr and /usr/local.DISTRO=Arch
Registered Linux User #388732
- 02-24-2011 #3
Your package Manager takes care of that stuff.
If you build it from soure it is different.
I had a simular post that is here http://www.linuxforums.org/forum/pro...best-done.html
- 02-24-2011 #4Just Joined!
- Join Date
- Jan 2011
- Posts
- 59
- 02-24-2011 #5
Nope. The format you are using would be more appropriate to /opt, but we don't generally recommend that.
Let's suppose that the name of the application is "my_app". In that case, you might create the following:
/usr/local/bin/my_app
/usr/local/share/doc/my_app/user_manual.pdf
/usr/local/share/pixmaps/my_app.png
This is the standard, and is generally expected. You can, of course, use whatever format you would like. I have seen software that takes a very different approach, but it is generally confusing to use.DISTRO=Arch
Registered Linux User #388732
- 02-24-2011 #6
One thing to keep in mind if you use the shell a lot, is that unless the directory with your binaries is added to the $PATH variable, you'll need to execute the application by it's full directory path (/usr/bin/local/company/myapp) instead of just the name of the binary (myapp).
Usually the most popular locations are already added to the $PATH variable, but you can easily add a location to it.
To see what is already in your $PATH:
To add a directory to your $PATH:Code:echo $PATH
If you'd like to make the change permanent, you can add it to your .bash_profile script in your home directory.Code:PATH=$PATH:/usr/bin/local/company/myapp export PATH


Reply With Quote
