Fundamentals 16 min read

Understanding the Linux Filesystem Hierarchy Standard (FHS) and Common Directory Commands

This article explains the Linux Filesystem Hierarchy Standard (FHS), describes the purpose and typical contents of each top‑level directory such as /home, /boot, /etc, /usr, and /var, and demonstrates essential shell commands for navigating and managing these directories, including absolute and relative paths.

IT Services Circle
IT Services Circle
IT Services Circle
Understanding the Linux Filesystem Hierarchy Standard (FHS) and Common Directory Commands

Linux and UNIX file systems are organized as a tree rooted at / . To avoid the naming chaos of early UNIX implementations, the File System Standard (FSSTND) was introduced in 1994 and later evolved into the File System Hierarchy Standard (FHS), which defines a consistent directory layout for Linux distributions.

The FHS specifies two levels of rules: the first level dictates what type of data belongs directly under / (e.g., configuration files in /etc , executables in /bin and /sbin ); the second level defines the purpose of sub‑directories such as /usr and /var .

/home

The /home directory holds user home directories.

/boot

/boot contains static files required for booting the system, such as the Linux kernel ( vmlinuz ) and, when using grub2 , the /boot/grub2 sub‑directory.

/dev

/dev provides device nodes (character devices like mouse and keyboard, block devices like hard disks). Important examples include /dev/hda , /dev/hdb , /dev/tty0 , /dev/tty1 , /dev/sda , and /dev/lp0 .

/etc

/etc stores system‑wide configuration files (e.g., /etc/passwd , /etc/fstab , /etc/modprobe.d ). Binary files should reside in /bin or /sbin , not in /etc .

/lib

/lib holds shared libraries needed by executables in /bin and /sbin .

/media and /mnt

/media is used for mount points of removable media (USB, CD‑ROM, etc.), while /mnt is intended for temporary mounts.

/opt

Third‑party application packages are installed under /opt , each creating its own sub‑directory (e.g., /opt/sample/bin ).

/proc

/proc is a virtual filesystem exposing kernel and process information (e.g., /proc/cpuinfo , /proc/interrupts ).

/sbin

System administration binaries required for boot and recovery reside in /sbin (e.g., arp , halt , ifconfig ).

/tmp

Temporary files are stored in /tmp and are cleared on reboot.

/sys

Like /proc , /sys is a virtual filesystem exposing hardware‑related information.

/usr

/usr (Unix Software Resource) contains the majority of user‑land software. Important sub‑directories include /usr/bin , /usr/lib , /usr/local , /usr/sbin , /usr/share , /usr/games , /usr/include , and /usr/src .

/run and /var

Runtime data that used to be under /var/run is now placed in /run . The /var hierarchy stores variable data such as caches ( /var/cache ), logs ( /var/log ), crash dumps ( /var/crash ), and temporary files ( /var/tmp ).

/srv

/srv holds data for services (e.g., web or FTP servers).

Absolute and Relative Paths

Absolute paths start from the root ( / ), while relative paths are expressed with respect to the current directory (e.g., ../var/log ). Special entries . (current directory) and .. (parent directory) are also used.

Directory‑Related Commands

cd

The cd command changes the current working directory. Common usages:

cd /path/to/dir   # change to specified directory
cd ./             # stay in current directory
cd ..             # move to parent directory
cd ~              # go to the user's home directory

pwd

pwd (Print Working Directory) displays the absolute path of the current directory and can also show paths of specified directories.

mkdir

mkdir creates new directories. Useful options:

-m set permissions directly

-p create parent directories recursively

mkdir -m 711 test2

rmdir

rmdir removes empty directories; with -p it can remove a hierarchy of empty directories. To delete non‑empty directories, use rm -r .

mv

mv renames or moves files and directories (e.g., renaming test to a more descriptive name).

PATH Environment Variable

The PATH variable tells the shell where to look for executable files. When a command like ls is entered, the system searches each directory listed in PATH for an executable named ls and runs the first match found.

LinuxFilesystemShell CommandspathFHSdirectory
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.