LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Difference between /usr and /bin (https://www.linuxquestions.org/questions/linux-newbie-8/difference-between-usr-and-bin-339812/)

binarybob0001 07-04-2005 04:58 AM

Difference between /usr and /bin
 
I understand the difference between /sbin and bin, but what is the difference between /usr and /bin? Both of these store programs, right?

hardcorelinux 07-04-2005 05:06 AM

/usr Contains all commands, libraries, man pages, games and static files for normal
operation.

/bin Commands needed during bootup that might be needed by normal users.

binarybob0001 07-04-2005 05:27 AM

I have to add one more directory, the /opt directory. What is the difference between that and the other two?
Would I install X Window's programs in /usr? Thanks.

hardcorelinux 07-04-2005 05:43 AM

The /opt directory provides storage for large, static application software packages.According to Redhat,a package placing files in the /opt/ directory creates a directory bearing the same name as the package. This directory in turn holds files that otherwise would be scattered throughout the file system, giving the system administrator an easy way to determine the role of each file within a particular package.

For example, if sample is the name of a particular software package located within the /opt/ directory, then all of its files could be placed within directories inside the /opt/sample/ directory, such as /opt/sample/bin/ for binaries and /opt/sample/man/ for manual pages.

Large packages that encompass many different sub-packages, each of which accomplish a particular task, also go within the /opt/ directory, giving that large package a standardized way to organize itself. In this way, our sample package may have different tools that each go in their own sub-directories, such as /opt/sample/tool1/ and /opt/sample/tool2/, each of which can have their own bin/, man/, and other similar directories.

I think default X window installation path is /usr,but not sure check it.

binarybob0001 07-04-2005 05:25 PM

Thanks again! Things are starting to make much more sense. I went looking around again and I found some more info.

Essentially, any thing that I install should go into the opt directory. The opt directory contains programs or files that did not come with the default installation. Obviously, if I'm upgrading a tool in usr, I should install it in usr.

The usr directory contains more commands that are not essential for system maintenance. It also contains documentation, source code and libraries.

That means if I downloaded a new program like blender, I would put the source in /usr/src and install the executable files into /opt after compiling it.

Here is the article that I am reading http://www.freeos.com/articles/3102.

btmiller 07-04-2005 05:59 PM

Don't forget to check out the Filesystem Hierarchy Standard which explains this in nauseating detail. BTW, for most compiled from scratch software, the default is to put it into /usr/local, not /opt. Realistically, though, it doesn't matter that much. It's just to keep the system organized.

binarybob0001 07-04-2005 07:52 PM

Thank you! That document was exactly what I was looking for. The nauseating details is what I want to know.


All times are GMT -5. The time now is 01:31 AM.