Ryan Jacobs


Linux Filesystem

ryan@delta ~ $ ls /
bin   dev  home  lib64       mnt  proc  run   srv  tmp  var
boot  etc  lib   lost+found  opt  root  sbin  sys  usr

Root Filesystem

Name Purpose
/ Very top of of the filesystem. Stores the following directories.
/bin Essential binaries that need to be available to all users, e.g., bash, cat, cp, ls.
/boot Boot loader files, e.g., kernels, initrd, GRUB.
/dev Essential devices. Everything in Linux is a file; e.g., /dev/null, /dev/sda
/etc System-wide configuration files.
/home User's home directories. Contains saved files, personal settings, etc.
/lib Libraries essential for binaries in /bin/ and /sbin/.
/lib32 Special 32-bit libraries.
/lib64 Special 64-bit libraries.
/lost+found Used by fsck to repair any damages to the filesystem; i.e. unlinked files.
/media Mount points for removable media.
/mnt Mount points for manually mounted devices.
/opt Optional application software packages; i.e. Third-party software.
/proc Virtual filesystem providing process and kernel information as files.
/root Home directory for the root user.
/run Information about the running system since last boot, e.g., currently logged-in users and running daemons.
/sbin Essential system binaries that required root privileges; e.g., init, ip, mount
/srv Data served by the system, e.g., ftp or http
/sys Contains hardware information and control, e.g., temperature, fan, battery, disk, CPU.
/tmp Temporary files. All users have access, so don't store vital information! Wiped on every boot.
/usr Stores read-only user data. Contains the majority of user utilities and applications.
/var Variable files; e.g., logs, spool files, and caches.

/usr Subdirectories

Name Purpose
/usr/bin Non-essential command binaries.
/usr/include Standard include files.
/usr/lib Libraries for the binaries for in /usr/bin and /usr/sbin.
/usr/local Local data, specific to the host. Typically contains a bin, lib, and share.
/usr/sbin Non-essential system binaries.
/usr/share Platform-independent data, e.g., manuals, documentations, examples, etc.

/var Subdirectories

Name Purpose
/var/cache Application cache data. Can be deleted without loss of data.
/var/lib State information. Persistent data modified by programs as they run; e.g., databases.
/var/lock Lock files. Keeping track of what files are currently in use.
/var/log Log files. Created by various programs.
/var/tmp Temporary files to be preserved between reboots.