Linux Filesystem




December 10, 2016

Basics of linux filesystem.

Linux filesystem dates back to late 1960s, the early days of Unix. Most of the folders are three to four letters long, starting with:


Binary programs or executable files which are available to all users.

Includes GNU basic command line utilities essential to the system, such as ls, echo, grep etc.

Also includes GUI applications


Files essential to the booting of the system, such as:

  • Vmlinuz - Linux Kernel
  • - Memory locations for variables or functions
  • Initrd.img - Initial ramdisk, temporary root file system
  • Grub
  • EFI


Files for peripheral and component devices of your system:

  • /dev/js0 - First analogue joystick
  • /dev/nvme0 - First NVMe drive
  • /dev/sda - First SATA HDD / SSD
  • /dev/loop0 - First fake mounting point
  • /dev/null - Black Hole
  • /dev/random or /dev/urandom - Random number generator
  • /dev/zero - Zero


Configuration files for all programs. However, user specific configs are stored in /home/user/.config


Users Documents, Pictures, Videos, etc.

User specific config settings are stored in /home/user/.config as well as other . (dot) folders.


Shared library files and kernel modules.

Oftern ends with .so (Shared Object) extension.

  • /lib/modules - Kernel modules
  • /lib/x86_64 - Architecture specific
  • /lib32 /lib64 - Architecture specific


Removable media, such as CD, DVD, USB Flash drive.


Fixed drives, such as SATA Hard drive or Solid State Drives.


Additional applications which are not part of the default system.

This folder is an alternative to /bin, /usr/bin, /usr/local


Pseudo file system which provides an interface to kernel view of processes (e.g. currently running applications). Referred to by PID (Process ID).


Root users home folder, usually empty if there is no root user on the system. This is not the same as /home/root .


Binary programs or executable files which are reserved for access by Root user. Similar to /bin

Includes basic command line utilities, such as: blkid, iptables, mount, useradd and visudo.

Also includes some GUI applications, although not as many as /bin


Contains data which is served by the system, such as Website or FTP server.

/var/www is also a location where website data is stored.


Sysfs pseudo-filesystem which provides an interface to kernel view of hardware devices.

Lists more devices than /dev, such as CPU and Firmware.


Temporary files which are deleted on shutdown or reboot.


Contains programs and libraries installed by the distro:

  • /usr/bin - Applications which are available to all users
  • /usr/sbin - Applications which are reserved for access by Root user
  • /usr/games - Specific folder for games
  • /usr/include - C Header files
  • /usr/lib - Library files
  • /usr/local - Folder for anything locally installed by the system administrator. (Not touched by the distro)
  • /usr/share - Manual pages and other documents for applications


Variable data files which may regularly change, such as log files and printer spool

  • /var/backups - Backups of key system files
  • /var/cache - Cached data for applications
  • /var/crash - Crash data dumps
  • /var/lib - Dynamic libraries listed by owner application
  • /var/lock - Locked files
  • /var/log - Log data
  • /var/spool - Spool files for cron, Mail and printing
  • /var/tmp - temporary files which need to exist for longer than /tmp allows