Hi
Came across this interesting article. Sharing it with you all.
Harish Kotian
Quoting:
Stugon Explains: Linux Directory Structure
The first time when I used Linux I'm like 'I don't like Linux', well this is
because I just can't stand all those alien named folders I can't see my C, D,
E, F drives, I can't find add remove programs, No command prompt, etc. But the
thing is, Everything takes time to adopt so I just sat before my windows
machine surfed through internet, learned a bit and really started to love Linux
based OS Ubuntu. So, this article is for beginners who are pretty new and are
willing to know more about Linux Directory Structure.
Linux and UNIX file system is defined by 'Filesystem Hierarchy Standard (FHS)',
if you are a complete windows user and are new comer to Linux based OS like
Ubuntu or Fedora then the Linux directory structure may look alien with all
those cryptic named folders.
In this pdf we will go in to great detail explaining the file system structure
of Linux. To this particular post we will be using Ubuntu as the base and even
if you are using other Linux based OS, the file system will mostly be similar
to Ubuntu, So no worries.
Linux-Filesystem-Hierarchy-Standared
/ This is the root directory of your linux box, typically everything goes from
here. This is something like C drive of your windows machine.
/bin /bin directory contains essential user binaries which are required when
the system is mounted in single-user-mode. Don't get this confused with
'/usr/bin' where user specific applications like compiz or Firefox are stored.
/boot The name says it, Here the static files like GRUB and linux kernels
required to boot the system are stored.
/cdrom In simple this is the temporary location for CD-ROMs inserted in to your
system.
/dev The /dev directory contains all the device files. In linux world,
everything is seen as files and folders including your hardware. For example
you can find your hard drive under '/dev/sda' and cd-rom under '/dev/cdrom',
etc.
This drive not only contains physical devices but also contains virtual
pseudo-devices.
/etc /etc contains system wide configuration files which can be edited using
simple text editor. It does not contain user specific configuration files as
they are situated under each user's home directory.
/home The /home directory contains the home folder of each user. Each user has
write permission to his/her folder only and must obtain elevated permission to
modify system files.
Each users home folder contains user-specific-config files and data files.
/lib The /lib directory contains library files which are used by the binaries
in /bin and /sbin directories.
/media The /media directory contains sub folders of mounted removable media.
For example, if you insert some usb stick or cd-rom then you can see a folder
mounted automatically inside /media directory.
/mnt Simply speaking this is the temporary mounting point for system
administrators to mount other file systems like windows.
/opt This /opt directory is used by propitiatory software packages which
doesn't follow FHS.
/proc This is the directory which contains files representing system and
process information and basically it is very similar to /dev directory.
/root To be simple, this is the home directory of *root* user. It contains data
and config files of root user. Unlike normal users whose home folders are
situated in /home/user, Root users have their home folder directly under /root
directory.
/run This /run directory contains application state files which provided
application to store their transient files required like processes ID's and
sockets.
/sbin This /sbin directory is actually similar to /bin directory but contains
system administration binaries which are generally intended to run by the root
user.
/selinux This directory has nothing to do with Ubuntu as Ubuntu doesn't use
SElinux. Actually /selinux is used to store security related files which is
also similar to /proc directory. SElinux is used by other linux distros like
Fedora and Red Hat.
/srv /srv is defined as the directory containing service data.
/tmp The /tmp directory contains all the temporary files of running
applications which are deleted as soon as the application is closed or after
some interval.
/usr The /usr directory contains user binaries and other read only data of
specific user and not the system specific binaries or data.
There are other sub folders in /usr directory like /usr/local where locally
compiled applications are installed, /usr/bin where non-essential applications
are installed, /usr/sbin where non-specific system administration binaries
stored.
/var To be simple this is a writable version of /usr(which is read-only) folder
which contains variable data files like logs files.
Note: Ubuntu may also contain files and folders which are not yet included in
FHS. EX: /cdrom