Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-22-2002, 08:29 PM   #1
Registered: Dec 2001
Location: Marietta
Distribution: Slackware 8.0
Posts: 95

Rep: Reputation: 15
Unhappy Filesystem Hierarchy Question - You probably get these alot. Sorry :(

Well, I'm sure of the purpose for most of the main directories:


Ok. Let me try to ask my question.

Some of these directories I don't understand, and I think I know why for most of them. It's probably because I'm always using my Linux machine for single-person use. I'm always alone. No one else logs in. So, if you can help me, pretend in your explanation that I'm in an office, with 30 users that login to the machine daily. I think that would help. The questions:

/bin - these are programs. Why arent the programs from /usr/bin in here? The only explanation I can think of is "the programs in /bin are only meant to be run by someone sitting at the computer being logged into". But, then what is the point of..

/sbin - why is this here? This is only to be used by root right? That kind of conflicts with what I just guessed.

/lib - I get /lib, but, I dont see why /usr/lib isn't part of /lib. Why separate them? I would think it would be easier to keep them together. Less places to add to

/lost+found - what the hell is this?

/opt - I don't understand this at all really. I install all my programs here with a --prefix=/opt/xxx option, but, isnt /bin or /usr/bin the places programs are supposed to go? Why is /opt here? What is it's purpose?

/tmp - is this an automatic temp file directory like Windows? Or is this just a folder made by an install assuming I want to use a temp directory.

/usr - mostly questions listed below.

/usr/bin - I suppose this is the directory where I would have programs installed for all users to use? As opposed (maybe?) to /bin?

/usr/local - what the hell? Local? I don't understand this at all.

/usr/share - same as above.

/usr/src/linux - why would this be available to all users?

and last but not least..

/var - again..totally lost...

Thanks in advance for reading this far down! Any help you can give me would be great. I'm slowly putting Linux together in my brain, and this is a key step!

Last edited by JoeLinux; 04-22-2002 at 08:32 PM.
Old 04-22-2002, 09:12 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 252Reputation: 252Reputation: 252
let me clarify one a few ?

/opt - mainly for programs to be installed to..
/lost+found - a directory to put lost and found files after a fsck
/var - mainly for log type files.. things or files that change.
/usr/local - for non-admins..

its too hard to explain all of them out of my head though.. most unix books explain the directory tree... try this site out:
Old 04-23-2002, 08:18 AM   #3
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
There isn't a very consistent logic behind Linux's directory structure, but I think the following stuff is true(ish)

/bin: is for very basic system utilities (the kind you could assume existed if you were writing a shell script)

/sbin: is like /bin, except for programs root would want to run.

/usr/bin: basic system programs, daemons, etc. Some (e.g. pppd) might be in /usr/sbin.

/usr/local/bin: just for ordinary programs.

The split between /lib, /usr/lib and /usr/local/lib is broadly similar to that between /bin, /usr/bin and /usr/local/bin.

/opt: doesn't exist on all distributions. Mainly used for putting large desktop enviroments in (e.g. GNOME, KDE) so they don't clog up /usr/local

/tmp: a standard part of any UNIX directory tree. Just a place for any application to put temporary files.

/var is just like trickykid said.

/usr/share and /usr/local/share: Hold applications' global configuration files (/etc is more for system configuration files, although XWindows uses it too :S). Generally you could expect a program installed in /usr/bin to use /usr/share and a program installed in /usr/local/bin to use /usr/local/share. The share directories also hold icon pixmaps, etc.

/usr/src/linux: generally big files that don't belong in /var, /etc, /opt or /tmp go in /usr, which is probably why src is in /usr.

As an additional complication, some of the directory structure is a result of traditional UNIX systems having several different partitions in the main directory structure (this is still standard practice in the BSDs). Typically /, /usr, /tmp, /var and /etc were mounted as separate partitions, and since /usr was the biggest partition, a lot of files ended up going in there. This historical stuff is partly responsible for the confusing /bin and /usr/bin split.

Having said all that crap though, it's not really worth worrying about it, especially as different distributions have different layouts anyway.
Old 04-23-2002, 08:28 AM   #4
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 8.04
Posts: 668

Rep: Reputation: 31
Pretty much all of the above. Also look here for an explanation of how a Linux filesystem is "supposed to be".
Old 04-23-2002, 10:33 AM   #5
Senior Member
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 47
There are attempts to standardise the Linux file structure, which can be found at the FHS website.

You should download the latest release for an explanation of what everybody 'should' be following.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Level Hierarchy Programming 4 11-27-2005 05:30 PM
#include hierarchy Programming 2 11-27-2005 12:50 PM
Creating a group hierarchy? statuszero Linux - Security 5 07-16-2004 04:18 PM
Desktop hierarchy filesystem: I WANT TO CHANGE IT!! opioid Linux - Software 2 03-28-2004 02:32 AM
NEWBIE here with alot of question... please help... i dont want to go back to XP... The SIN Raven Linux - Software 33 06-06-2003 10:20 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration