Linux File System Structure

This entry is part 1 of 6 in the series Beginner Linux Administrator

While initially discussion on the file system structure isn’t the most exciting part of Linux. Knowing how the Linux file system is structured will help you understand Linux and be a better Linux user and administrator.

The Linux File system is different in that it has One Tree and One Root. There are no C: D: or E: drives like on Windows. Rather there is one main file system that is the storage area known simply as the root and reffered to with a forward slash (/). Instead of accessing multiple storage devices by drive letters like C: and D:, each storage device is positioned within the main root file system tree. The storage device is added using the mount command (discussed later) and appears as if it were another directory within root.

The Default directories and there definitions:

A complete list can be found at www.wikipedia.org/wiki/Filesystem_Hierarchy_Standard and detailed descriptions at FHS

Nobody is expected to memorize the entire File System Structure, so don’t try to. Instead over time you will become familiar with the main directories and can reference this article for the ones you can’ remember.

/ 	Primary hierarchy root and root directory of the entire file system hierarchy.
/home/ 	Users' home directories - containing Users files and personal settings
/root/ 	Home directory for the root user
/bin/ 	Essential command binaries that need to be available in single user mode; for all users (e.g., cat, ls, cp).
/boot/ 	Boot loader files (kernels, initrd). Often a separate partition.
/dev/ 	Essential devices
/etc/ 	Host-specific system-wide configuration files (the name comes from et cetera).

    /etc/opt/

	Configuration files for /opt/.

    /etc/X11/

	Configuration files for the X Window System, version 11.

    /etc/sgml/

	Configuration files for SGML.

    /etc/xml/

	Configuration files for XML.

/lib/ 	Libraries essential for the binaries in /bin/ and /sbin/.
/media/ 	Mount points for removable media such as CD-ROMs
/mnt/ 	Temporarily mounted filesystems.
/opt/ 	Optional application software packages.
/proc/ 	Virtual filesystem documenting kernel and process status as text files

/sbin/ 	Essential system binaries (init, route, ifup).
/srv/ 	Site-specific data which is served by the system.
/tmp/ 	Temporary files (see also /var/tmp). Often not preserved between system reboots.
/usr/ 	Secondary hierarchy for user data; contains the majority of (multi-)user utilities and applications.[1]

    /usr/bin/

	Non-essential command binaries; for all users.

    /usr/include/

	Standard include files.

    /usr/lib/

	Libraries for the binaries in /usr/bin/ and /usr/sbin/.

    /usr/sbin/

	Non-essential system binaries (daemons for various network-services).

    /usr/share/

	Architecture-independent (shared) data.

    /usr/src/

	Source code (the kernel source code with its header files).

    /usr/X11R6/

	X Window System or Graphical User Interface files

    /usr/local/

	Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, (bin/, lib/, share/)
/var/ 	the Logs, spool files, and temporary e-mail files.

    /var/lib/

	State information. Persistent data modified by programs as they run (e.g. databases, packaging system metadata etc.).

    /var/lock/

	Lock files. Files keeping track of resources currently in use.

    /var/log/

	Log files. Various logs.

    /var/mail/

	Users' mailboxes.

    /var/run/

	Information about the running system since last boot (e.g. currently logged-in users and running daemons).

    /var/spool/

	Spool for tasks waiting to be processed (e.g. print queues and unread mail).

    /var/spool/mail/

	Deprecated location for users' mailboxes.

    /var/tmp/

	Temporary files to be preserved between reboots.

Now that you know where stuff is located we can get to the more exciting stuff.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Fabio Milano has written 79 articles for us. Fabio Milano is a certified RHCE, MCP, and CFOI. He runs an IT consulting and services company called RDS Support inc. Website:http://www.rdssupport.com
The information provided is for educational purposes only. All content including links and comments is provided "as is" with no warranty, expressed or implied. Use is at your own risk and you are solely responsible for what you do with it.

No Comments

Leave a reply