What exactly is the FHS (Filesystem Hierarchy Standard)?

Q I've heard the term FHS banded about. What exactly is it and what is it for?

A The FHS or Filesystem Hierarchy Standard is a set of requirements or guidelines for where file and directories are located under Unix systems, and what some system files should contain. For instance, it advises that "applications must never create or require special files or subdirectories in the root directory", so that root partitions can be kept simple and secure to adminstrate. Most Linux distributions adhere to the FHS loosely, which is why the filesystem layout is fairly similar from one distro to another. Each of the folders in the FHS has a defined purpose. For example, /dev contains entries referencing devices attached to the system, /lib houses libraries required to run binaries in /bin and /sbin, while /usr holds most of the binaries and libraries which are used by you, the user, and as such is one of the key folders in any Linux system.

In a nutshell, the FHS is essential to the organised chaos within Linux. It means that users like you can come to expect certain directories in certain locations, and it also means that programs can 'predict' where files are located. The first filesystem hierarchy for Linux was released in 1994. In 1995, this was broadened to cover other Unix-like systems and take in BSD knowhow, and was renamed FHS. It is overseen by the Free Standards Group, which also runs the Linux Standards Base project. While all distros stick to the principles of FHS, some use the layouts in slightly different ways, or omit some of the usual directories, which is one of the reasons why different Linux systems are sometimes incompatible.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar