Filesystem Tree

July 3, 2016   

See Filesystem Hierarchy Standard for in depth details. This is a quick reference from the Filesystem Hierarchy Standard.

Main Directories:

  • /bin: Essential command binaries needed to boot. All users can use them. They must be available in single user mode.
  • /boot: Files needed to boot the system, such as kernel and boot loader.

    • vmlinuz: (required) the compresses Linux kernel
    • initramfs or initrd: (required) initial RAM filesystem, which mounts before the real root filesystem become available.
    • config: (optional) the configuration file used when compiling the kernel, for debugging purpose.
    • (optional) the kernel symbol table. useful for debugging
  • /dev: (pseudo-filesystems, exist only in memory) Device files, used to interact with hardware and software devices.

  • /etc: Host-specific system configuration

    • /etc/skel: skeleton files for newly created home directories
    • /etc/init.d: start up and shut down scripts for System V initialization.
    • /etc/sysctl.conf: Configuration file for setting system variables
  • /home: User home directories.

  • /root: home directory for root user.

  • /lib: Essential shared libraries and kernel modules. Libraries required by executable binaries in /bin and /sbin.

    • /lib/modules: kernel modules
  • /lib64: 64-bit libraries

  • /media: Mount point for removable media

  • /mnt: temporarily mounted filesystems

  • /opt: optional application software packages

  • /run: (pseudo-filesystems, exist only in memory) Data relevant to running processes

  • /proc: (pseudo-filesystems, exist only in memory) give information about system and processes running on it.

    • /proc/sys: system parameters. Equivalent to sysctl -a command. It can be used to get all system parameters that are in /proc/sys.
    • /proc/cmdline: the system booted with this command line.
  • /sbin: Essential system binaries. They are mostly administrative tools, that should be available only to the root user.

  • /sys: (pseudo-filesystems, exist in memory only) gather information about the system.

  • /srv: Data for services provided by this system

  • /tmp: Temporary files. They can be accessed by any user or application.

  • /usr: Secondary hierarchy. Used for files and application not needed for system booting, such as Multi-user application. It is theoretically read-only. It is one of the largest directory, in terms of disk space, in /.

    • /usr/bin: Contains most of the executable files that are not needed for booting or repairing the system.
    • /usr/sbin: Contains non-vital system utilities that are used after booting
    • /usr/local: local data and programs specific to the host.
  • /var: Variable data that change during system operation.

    • /var/log: contains most of the log.

    • /var/log/wtmp – Contains all login and logout history. Equivalent to this command $ last

    • /var/log/btmp – Records failed login attempts. Equivalent to this command $ lastb

    • /var/spool: Tasks spooled or waiting to be processed such as mail, print queues and cron jobs data.

    • /var/run: Information about the running system since the last boot.

    • /var/run/utmp – Logs the present login state of each user. Equivalent to this command $ who

    • /var/mail: user mailboxes.

comments powered by Disqus