Lesson 01: The Linux Directory Structure

Posted: May 31, 2011 in Linux: From Noob to Ninja

                                                                                                                                                                   

The Linux directory structure follows the  Filesystem Hierarchy Standard (FHS) that is a standard for most UNIX and Linux Operating Systems  you can visualize it as an upside down tree. At the top is the root or / directory below the root directory are a set of common directories such as etc, home, root, usr, and var .Each of these directories can contain subdirectories such as the home directory can can have subdirectories for user Josh and user Sam.  In DOS and Microsoft Windows file systems drive letters represent storage devices such as C: as a hard drive. In Linux all storage devices are stored in the file hierarchy which means /usr or /home or /var can be stored on their own hard drives and this would not be apparent to user who would see it as a whole directory structure. Slashes / rather then backslashes \ are used to seperate directory names in Linux such as /home/josh. In Linux, all things are considered files. Programs, scripts, directories, devices and configuration files are all considered files filenames such as .doc or .mp3, while except-able to use have no meaning in Linux.  Every file and directory  has separate file  permissions and ownership set for the user (UID), the group the user belongs to (GID), and global users (WORLD).

Below is a list of the common Linux directories and what they are used for:

/bin – Contains Linux user commands and utilities

/boot – Contains the Linux Kernel and boot loader config files

/dev – Contains files that represent access points to devices on your system such as Floppy drives, Hard drives, CDROM, and RAM.

/etc – Contains admin config files

/home – Contains the files of the users on the system

/media – Creates a location for mounting devices IE: USB, CD, DVD, and hard drives

/proc – Provides system resource tracking for the kernel

/root – The root user’s home directory not to be confused with /

/sbin – Contains administrative commands and daemons

/sys –   Added in Linux 2.6 kernel and is intended to contain files for getting hardware status and reflecting the systems device tree as seen by the kerneln

/tmp – Contains temporary files

/usr – Contains user’d files and programs IE: documentation, games, graphical files,  and libraries

/var – Contains files in which the content varies IE: System log files, print, and mail files

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s