Linux File Structure

From TWUUG

There are many differences between Linux and a MS-Windows system, but the most noticeable and beneficial is the file system. In Linux we do not use drive letters to symbolize different partitions or drives. Under Linux, there is one main directory the / or root directory. You can relate this to the C: drive under MS-Windows. Each directory can be a directory or a mounted partition. The main directory is called the root directory, and it's denoted with a single slash (/). This concept may seem strange, but it actually makes life easy for you when you want to add more space. As an example, lets say you are running out of space in your home directory, in Linux you can hook a new hard drive up to your computer, copy the files from your home directory to it and mount it as your /home directory. This functionality allows a lot less modification and trouble when expanding your system.

Now we will talk about the standard directories under the root directory.

  • bin - This directory contains the binary or executable files that launch applications, all users have access to these applications. These represent the bare minimum set of programs required for a user to use the system.
  • boot - This directory contains the files necessary to boot up your computer including the boot loader and kernel activation files.
  • dev - This directory contains the file pointers for character and block devices, which means the pointers to hard drives, flash drives, multimedia cards, external devices and system ports.
  • etc - this directory contains the system configuration files and scripts.
  • home - This directory contains the user profiles, desktops and user files, it functionality is similar to the “Documents and Settings” directory in MS-Windows.
  • lib - This directory contains library files that are necessary for all programs to work.
  • media - This directory is used by hal, the Linux auto-mounter, to load external devices for navigation such as floppy disks, cd-roms, dvd-roms, flash drives, etc...
  • mnt - This directory is used to load external devices on system that do not use hal.
  • opt – This directory contains optional software packages. Usually the contents of X11 and your window manger and loaded into opt, but you can add whatever programs you wish to this directory.
  • proc – This directory is unique because it is not necessarily part of the file system, but a virtual file system that provides access to kernel or system information.
  • root – This is the home directory for your root or system administrator. It is kept separate from the other users in case the partition that home is mounted on fails.
  • sbin – This directory has a functionality similar to bin, which means it contains application executables, but rather than allowing all users access to these programs it restricts access only to the root or administrator.
  • tmp – This is the temporary storage location. All users have read and write rights to the contents of this directory.
  • usr – This is the largest directory on a Linux system. Pretty much everything that does not belong in the other directories is placed here. The contents usually includes program, documentation and the kernel source code.
  • var – This directory contains most of the frequently changing files such as logging files, cache file and record locks.

For information about other directories in your root directory refer the the documentation for you chosen distribution.

Personal tools