Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Reply
Old 12-11-2008, 06:12 PM   #1 (permalink)
Osiris's Avatar
 

Join Date: Jan 2005

Location: Kentucky

Posts: 32,074

Osiris is a jewel in the roughOsiris is a jewel in the roughOsiris is a jewel in the rough

Send a message via ICQ to Osiris Send a message via AIM to Osiris Send a message via MSN to Osiris Send a message via Yahoo to Osiris Send a message via Skype™ to Osiris
Default Get to Know Linux: File System Hierarchy

Get to Know Linux: File System Hierarchy

The Linux file system hierarchy is much different than that of Windows. So much so that it becomes a show stopper for many new users. I hope to clear up a lot of the confusion here and now at gHacks. So, without further adieu, I give you the Linux file system hierarchy.
/ - This is the base, or root, of the file system. Everything in the Linux system is housed in this directory.
/bin - This directory contains a number of essential commands that are available to unprivileged users (such as cat, chmod, chown, etc). The /bin directory also houses the shells (such as bash).

/boot - This directory contains everything necessary for the boot process. Without the /boot directory, your machine would not be able to boot up.
/dev - This directory contains all of the special and device files. With Linux all devices and drives have a name. Hard drives tend be labeled as hda, hdb, hdc. Special devices such as external usb devices can be labeled as sda, sdb, sdc. If you look in the /dev directory you will see quite a few files that can be associated with devices. Most of the devices found here are either block or character devices. Block devices hold data (such as a hard drive) and character devices transmit data (such as a mouse).
/etc - This is a very special directory that contains numerous configuration files and directories. This directory will contain the X configurations, Apache, Samba, the init system, etc. The /etc directory also houses the sources for package management systems like apt and yum. One of the most important subdirectoris in /etc is the /etc/init.d (or in Red Hat based systems, /etc/rc.d/init.d). This subdirectory contains all of the initialization scripts for services such as networking, samba, apache, cron, hal, etc.
/home - This is where all user data is housed. Each user on the system will have their own subdirectory within /home. All user data and user-specific configuration files are saved here.
/lib - This is where all kernel modules needed for system boot libraries that are required by root system commands (commands found in /bin and /sbin.)
/lost+found - If your system crashes or is shut down improperly any lost data will be stored here. During a recovery boot the fsck application will attempt to recover corrupt files found here.
/media - This is where all external media (or extra internal drives) is mounted. If you make or edit entries in the /etc/fstab file you will point devices (such as /dev/sda to directories withing /media.)
/mnt - This is another directory where external (and internal) drives and devices are mounted. This is a holdover to older school thought. Most modern distributions are moving to the /media directory.
/opt - This is a directory that can be used for installing applications that are outside of the default installation. When you install applications here they can be used system wide by all users. Only the root user can install applications here.
/proc - This is a special directory that is actually a virtual filesystem. The /proc directory acts as a process information center for the kernel.
/root - This is the root users home directory.
/sbin - This is where all system maintenance/administration executable files are stored. These commands differ from those in /usr/sbin in that they are system commands used for critical system administration and maintenance whereas /usr/sbin are non-critical tasks such as user administration, network administration, etc.
/usr - This is one of the largest directories on your system as it contains all user-executable binaries as well as the libraries, documentation, and header files for these executables. One of the most important subdirectories is /usr/bin where all user application executables are stored.
/var - This directory contains all variable data such as log files. On a server environment the document root directory of most servers will be found here (/var/www and /var/ftp are examples.)
/srv - This directory can contain the services (such as www) directory in some distributions.
/tmp - This directory, as you would expect, contains temporary files that are stored as needed. Many files you will find here are lock files created by applications. Do not remove anything from this directory as the cron system has a job specifically created for the removal of these files.
And there you have it. A description of each directory in the Linux file system hierarchy.
__________________
Osiris is online now   Reply With Quote
Old 12-13-2008, 07:46 AM   #2 (permalink)
oldskool's Avatar
 
Electrical Systems Design

Join Date: Jun 2008

Location: Maine, USA

Posts: 1,646

oldskool has a spectacular aura aboutoldskool has a spectacular aura about

Default Re: Get to Know Linux: File System Hierarchy

Nice post Osiris ! Thanks, very convenient.
oldskool is offline   Reply With Quote
Old 12-13-2008, 10:22 PM   #3 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: Get to Know Linux: File System Hierarchy

This is getting stickied.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline   Reply With Quote
Old 12-14-2008, 12:38 AM   #4 (permalink)
oldskool's Avatar
 
Electrical Systems Design

Join Date: Jun 2008

Location: Maine, USA

Posts: 1,646

oldskool has a spectacular aura aboutoldskool has a spectacular aura about

Default Re: Get to Know Linux: File System Hierarchy

I just printed it and it is now stickied with tape next to my monitor.
oldskool is offline   Reply With Quote
Old 12-14-2008, 03:41 PM   #5 (permalink)
 
Monster Techie

Join Date: Nov 2006

Location: Illinois, USA

Posts: 1,765

CalcProgrammer1 will become famous soon enough

Default Re: Get to Know Linux: File System Hierarchy

Already knew a lot of these, but interesting post nonetheless.
__________________

CalcProgrammer1 is offline   Reply With Quote
Old 12-14-2008, 08:04 PM   #6 (permalink)
carnageX's Avatar
 

Join Date: Feb 2007

Location: South Dakota

Posts: 6,054

carnageX is just really nicecarnageX is just really nicecarnageX is just really nicecarnageX is just really nice

Send a message via AIM to carnageX Send a message via MSN to carnageX
Default Re: Get to Know Linux: File System Hierarchy

Quote:
Originally Posted by CalcProgrammer1 View Post
Already knew a lot of these, but interesting post nonetheless.
Not everybody is a *nix expert like you and Saxon .
__________________
Sorry but I do not accept support questions via E-mail, PM, or IM.




3DMark06 Score: 15418 | carnageX | e6750 @ 3.54GHz | GTX 285 @ 648/1242 | Windows 7 Beta 1 64bit


If I help you, or you just like what I said, rep me by clicking the scale under my avatar
carnageX is offline   Reply With Quote
Old 12-14-2008, 11:29 PM   #7 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: Get to Know Linux: File System Hierarchy

It's a handy reference for the *nix noob's an it gives a much better / easier to read explanation of the file system hierarchy than I can.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline   Reply With Quote
Old 12-15-2008, 05:26 PM   #8 (permalink)
Nick's Avatar
 
Courtesy of Mak.

Join Date: Feb 2007

Location: Chichester, England

Posts: 4,003

Nick is on a distinguished road

Send a message via MSN to Nick
Default Re: Get to Know Linux: File System Hierarchy

I knew most of them from fiddling with my iPod, helpful non the less.
__________________
Every time I get Rep, I die inside.

Cisco Cert.
Nick is offline   Reply With Quote
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer Still acting screwy Shana2415 Virus - Spyware Protection / Detection 10 09-03-2008 11:36 AM
My Hijackthis log file, please help! soarwitheagles HijackThis Logs (finished) 1 08-31-2008 01:11 PM
Linux Software: Backup Solutions Osiris Linux Tips and Tricks 3 07-25-2008 01:04 AM
WTF is a Bad Block? MikesCreation Hardware Troubleshooting 18 02-24-2008 09:31 PM
Hard Drive Errors!!! Bad or Faulty HDD? mike4realz Hardware Troubleshooting 3 09-19-2007 01:56 AM