The Ubuntu Filesystem Hierarchy: What is in it?

Anytime you are working with any operating system you should understand how the basic file system structure works. This is the same for working with Ubuntu Linux. Linux has inherited a well-planned hierarchy from UNIX which stores all of the information on your computer everything from your configuration files to your pictures is stored somewhere in the file system. This article will explain the basic Linux file system structure.

The top most directory that holds all of the other files and directories in the Linux operating system is called “root” which is represented by a forward slash (/). Inside the root directory is several other directories that have specific purposes. The table shown below will give a basic overview of each directory’s purpose.

/ The Root Directory.
/binContains common essential commands for running and booting the system.
/bootContains the bootable Linux kernal and boot loader files needed for the system to boot.
/devContains files that represent devices attached to your computer such as CD-ROM or Hard disks.
/etcContains System configuration files. This can be the configuration files for everything from running a Web server to what processes and applications will start with the system.
/homeContains directories specific to each user’s home directory. Inside the home directory you often find directories for each username. Inside each username directory is all of the user’s files and documents.
/libContains shared libraries and kernel modules that are required to boot the system and run commands.
/lost+foundContains recobered files that are found after a file system check.
/media Provides a location for mounts points for removable media such as CD-ROM drives and USB flash drives.
/mntProvides a location for mount points for local, and remote file systems temporarily mounted to the system.
/optContains add-on software packages.
/procProvides a mechanism for the kernel to send information to processes. The /proc directory only exists when the system is running and resides in the system memory. It can also be known as a virtual filesystem. Displaying the files inside the /proc directory can give you information such as CPU information and memory status.
/rootContains the super user’s (root) home directory.
/sbinContains the system commands needed for booting the system that are not normally used by normal users.
/srvContains information that pertains to services running on the system.
/sysContains real-time information for hardware devices that are being used by the kernel. very similar to the /proc directory.
/tmpContains temporary files used by applications on the system.
/usrContains user documentation and software that is not essential for system operations. The software and documentation stored in this directory is shared by everyone on the system.
/varContains variable data such as logs or spooled files. examples of this could be access logs and the print spooler queues.

Listed above is a few of the main directories in the Linux file system hierarchy. You can also run the command: man hier to get the man page for the Linux file system hierarchy. 

Knowing what goes in each system directory with help you later if you ever decide to partition hard drives on a new installation. It will also help with knowing where to look for certain files in Linux.

If you have any questions or comments on the Ubuntu file system hierarchy, don’t hesitate to leave a comment below. Also, if you found this post helpful please like and share so that other people will find this post more easily.