Monday, March 18, 2013

What's the purpose of each directory in a standard linux install?

Run the following command:
man hier
and you'll have something like this that prints to your screen:
HIER(7)                                                                                                                Linux Programmer's Manual                                                                                                                HIER(7)

NAME
       hier - Description of the file system hierarchy

DESCRIPTION
       A typical Linux system has, among others, the following directories:

       /      This is the root directory.  This is where the whole tree starts.

       /bin   This directory contains executable programs which are needed in single user mode and to bring the system up or repair it.

       /boot  Contains static files for the boot loader.  This directory only holds the files which are needed during the boot process.  The map installer and configuration files should go to /sbin and /etc.

       /dev   Special or device files, which refer to physical devices.  See mknod(1).

       /etc   Contains  configuration  files  which  are local to the machine.  Some larger software packages, like X11, can have their own subdirectories below /etc.  Site-wide configuration files may be placed here or in /usr/etc.  Nevertheless, programs should
              always look for these files in /etc and you may have links for these files to /usr/etc.

       /etc/opt
              Host-specific configuration files for add-on applications installed in /opt.

       /etc/sgml
              This directory contains the configuration files for SGML and XML (optional).

       /etc/skel
              When a new user account is created, files from this directory are usually copied into the user's home directory.

       /etc/X11
              Configuration files for the X11 window system (optional).

       /home  On machines with home directories for users, these are usually beneath this directory, directly or not.  The structure of this directory depends on local administration decisions.

       /lib   This directory should hold those shared libraries that are necessary to boot the system and to run the commands in the root file system.

       /media This directory contains mount points for removable media such as CD and DVD disks or USB sticks.

       /mnt   This directory is a mount point for a temporarily mounted file system.  In some distributions, /mnt contains subdirectories intended to be used as mount points for several temporary file systems.

       /opt   This directory should contain add-on packages that contain static files.

       /proc  This is a mount point for the proc file system, which provides information about running processes and the kernel.  This pseudo-file system is described in more detail in proc(5).

       /root  This directory is usually the home directory for the root user (optional).

       /sbin  Like /bin, this directory holds commands needed to boot the system, but which are usually not executed by normal users.

       /srv   This directory contains site-specific data that is served by this system.

       /tmp   This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up.

       /usr   This directory is usually mounted from a separate partition.  It should hold only sharable, read-only data, so that it can be mounted by various machines running Linux.

       /usr/X11R6
              The X-Window system, version 11 release 6 (optional).

       /usr/X11R6/bin
              Binaries which belong to the X-Window system; often, there is a symbolic link from the more traditional /usr/bin/X11 to here.

       /usr/X11R6/lib
              Data files associated with the X-Window system.

       /usr/X11R6/lib/X11
              These contain miscellaneous files needed to run X;  Often, there is a symbolic link from /usr/lib/X11 to this directory.

       /usr/X11R6/include/X11
              Contains include files needed for compiling programs using the X11 window system.  Often, there is a symbolic link from /usr/include/X11 to this directory.

       /usr/bin
              This is the primary directory for executable programs.  Most programs executed by normal users which are not needed for booting or for repairing the system and which are not installed locally should be placed in this directory.

No comments:

Post a Comment

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.