Posted on

Linux Filesystem Hierarchy

Files and folders are located in a predictable location across almost all Linux distributions, this is known as the filesystem hierarchy standard (FHS). At the base of the file structure is the root, all other locations are arranged relative to this.

Important directories and their respective uses are listed in the table below.

DirectoryDescription
/The root of the filesystem (only one on a system). Files and folders are arranged relative to this location.
/binBinaries (programs) the system needs to work.
/bootContains kernel and initial filesystem.
/devReferences to devices on the filesystem.
/etcConfiguration files for software and tools.
/homeStores users’ home folders (data)
/libLibraries associated with system binaries
/mediaMount point for removable media
/mntMount point for hard drives, network shares, etc.
/optUser-installed software (optional packages).
/procRepresents information about kernel and processes.
/rootHome folder for root user.
/runInformation about running processes (PIDs, etc.).
/sbinSystem binaries.
/srvFiles served by the system.
/sysRepresents parts of the system (fs, devices, etc.).
/tmpTemporary information that can be erased.
/usrAnother location for system and user binaries.
/varFiles that can vary (logs, etc.).