Signup/Sign In

Linux File System Hierarchy(FHS)

The Linux Filesystem Hierarchy Standard (FHS) is a set of guidelines and standards that define the structure and organization of files and directories in a Linux-based operating system. It is intended to provide a consistent and predictable layout of files, making it easier for users and developers to locate and manage data across different Linux distributions.

The FHS was first published in 1993 and has since been updated to reflect changes in the Linux ecosystem. It is maintained by the Linux Foundation and is considered an important part of the Linux Standard Base (LSB). The FHS defines a hierarchical directory structure that is similar to the Unix file system model. It organizes files and directories into a tree-like structure, with the root directory ("/") at the top and branches leading to subdirectories and files.

Here is a brief overview of the key directories and their purposes, along with some common Linux commands that can be used to navigate and manipulate them:

  1. /: This is the root directory of the filesystem hierarchy. All other directories and files in the system are located under this directory.
  • Commands:
    • cd /: Change the current directory to the root directory.
    • ls /: List the contents of the root directory.

1

  1. /bin: This directory contains essential system binaries (i.e., programs) that are necessary for basic system functionality.

2

  1. /sbin: This directory contains essential system binaries that are necessary for system administration tasks. These binaries typically require root privileges to run.

3

  1. /usr: This directory contains user-related files and programs.

4

  1. /etc: This directory contains configuration files for the system and applications.

5

  1. /home: This directory contains the home directories for each user on the system.

6

  1. /var: This directory contains variable data files, such as log files, mail spools, and temporary files.

7

  1. /tmp: This directory contains temporary files that are created by applications and services.

8

Conclusion

The Linux File System Hierarchy Standard (FHS) is a set of guidelines that dictate the organization of files and directories in a Linux operating system. The FHS standardizes the placement of files and directories, making it easier for users and developers to navigate and understand the file system structure.



About the author:
Pradeep has expertise in Linux, Go, Nginx, Apache, CyberSecurity, AppSec and various other technical areas. He has contributed to numerous publications and websites, providing his readers with insightful and informative content.