Open In App

Linux File Hierarchy Structure

The Linux File Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation. 

linux-directory

1. / (Root): 

Primary hierarchy root and root directory of the entire file system hierarchy. 



root-linux-directory

2. /bin : 

Essential command binaries that need to be available in single-user mode; for all users, e.g., cat, ls, cp. 

bin-linux-directory

3. /boot :

 Boot loader files, e.g., kernels, initrd. 
 



boot-linux-directory

4. /dev :

 Essential device files, e.g., /dev/null. 

dev-linux-directory

5. /etc :

 Host-specific system-wide configuration files.

etc-linux-directory

6. /home :

 Users’ home directories, containing saved files, personal settings, etc.

home-linux-directory

home-linux-directory

7. /lib:

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

lib-linux-directory

8. /media:

 Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).

media-linux-directory

9. /mnt :

 Temporarily mounted filesystems.

mnt-linux-directory

10. /opt : 

Optional application software packages.

opt-linux-directory.

11. /sbin : 

Essential system binaries, e.g., fsck, init, route.

sbin-linux-directory

12. /srv : 

Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.

srv-linux-directory

13. /tmp : 

Temporary files. Often not preserved between system reboots and may be severely size restricted.

tmp-linux-directory

14. /usr : 

Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications. 
 

usr_bin-linux-directory

usr_sbin-linux-directory

usr_lib-linux-dirctory

usr_local-linux-directory

usr_src-linux-directory

15. /proc:

 Virtual filesystem providing process and kernel information as files. In Linux, it corresponds to a procs mount. Generally, automatically generated and populated by the system, on the fly.

proc-linux-directory

proc-linux-directory

Modern Linux distributions include a /run directory as a temporary filesystem (tmpfs) which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, such data were stored in /var/run but this was a problem in some cases because this directory is not always available at early boot. As a result, these programs have had to resort to trickery, such as using /dev/.udev, /dev/.mdadm, /dev/.systems or /dev/.mount directories, even though the device directory isn’t intended for such data.Among other advantages, this makes the system easier to use normally with the root filesystem mounted read-only. For example, below are the changes Debian made in its 2013 Wheezy release:

 

?list=PLqM7alHXFySFc4KtwEZTANgmyJm3NqS_L 
See your article appearing on the GeeksforGeek’s main page and help other Geeks. 

 


Article Tags :