What is The Meaning of Typical Linux Directories?

3 min
What is The Meaning of Typical Linux Directories?

The Filesystem Hierarchy Standard (FHS) specifies the directory structure and its contents in Linux distributions. It was founded and still is maintained by the Linux Foundation. In this hierarchy, all directories and files appear under the root / directory.

Commonly, many of these directories exist in all Unix-like operating systems and are typically used in the same way. I strongly encourage you to read the below list of directories with a short description each point:

  • / – the root directory of the entire file system hierarchy.
  • /bin (Essential User Binaries) – essential command binaries (e.g. cat, ls, cd, mkdir, cp) that are required to operate the system in a proper way and are available in single user mode; for all user.
  • /boot (Static Boot Files) – here we can find content called “boot loader” files e.g. initrd or kernels.
  • /dev (Device Files) – files of all devices; e.g. /dev/sda1 if we plug an SSD or HDD drive.
  • /etc (Configuration Files) – here was a lot of disputes about the name itself; directory should contain configuration files for entire local machine.
    • /etc/opt – configiration files fod add-on (additional) pavkages that are stored in /opt.
    • /etc/sgml – settings files, such as catalogs, for software that uses SGML.
    • /etc/X11 – conf. files for the X Window System (version 11)
    • /etc/xml – configuration files, such as catalogs, for software that processes XML.
  • /home (Home Folders) – user’s home directories, which contain personal data or other files that belong each user.
  • /lib (Essential Shared Libraries) – essential libraries and dependencies for the biaries in /bin and /sbin.
  • /media (Removable Media) – mount points for removable media such as pendrive, external HDD or CD-ROMs.
  • /mnt (Temporary Mount Points) – temporary mounted filesystems.
  • /opt (Optional Packages) – custom and optional application packages.
  • /proc (Kernel & Process Files) – virtual filesystem providing information about kernel and process information as files.
  • /root (Root Home Directory) – home directory for the root user.
  • /run (Application State Files) – runtime variable data: information about the running system since last boot, currently logged-in users and running deamons. Files under this directory must be either removed or truncated at the beginning of the boot process; but this is not necessary on systems that provide this directory as a temporary filesystem (tmpfs).
  • /sbin (System Administration Binaries) – essential system binaries, e.g., fsck, init, route.
  • /srv (Service Data) – site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
  • /sys (System Devices) – contains information about devices, drivers, and some kernel features.
  • /tmp (Temporary Files) – temporary files. Often not preserved between system reboots, and may be severely size restricted.
  • /usr (User Binaries & Read-Only Data) – contains many utilities and applications that are available for users.
    • /usr/bin – non-essential command binaries (not needed in single user mode); for all users.
    • /usr/include – Basic include files.
    • /usr/lib – standard libraries fot the binaries in /usr/bin and /usr/sbin.
    • /usr/local – third hierarchy for local data, specific to this host. Typically has next subdirectories, e.g., bin, lib, share.
    • /usr/sbin – non-essential system binaries, e.g., daemons for various network-services.
    • /usr/share – architecture-independent (shared) data.
    • /usr/src – source code with its header files.
  • /var (Variable files) – files which may change during the system process, whose content is expected to continually change during normal operation of the system, such as logs, spool files, and temporary e-mail files.
    • /var/cache – application cache data, such data are locally generated as a result of an application workflow.
    • /var/lib – state information; persistent data modified by programs as they run, e.g., databases, packaging system metadata and so on.
    • /var/lock – lock files. Files keeping track of resources currently in use.
    • /var/log – log files, various logs.
    • /var/mail – mailbox files. In some distributions, these files may be located in the deprecated /var/spool/mail.
    • /var/opt – variable data from add-on packages that are stored in /opt.
    • /var/run – run-time variable data. This directory contains system information data describing the system since it was booted. Commonly, we can find here symbolic links from the /run directory.
    • /var/spool – spool for tasks waiting to be processed, e.g., print queues and outgoing mail queue.
    • /var/tmp – temporary files to be preserved between reboots.

You can also read the post in which describe the HTOP tool. Have a nice reading!


Post a Comment

Your email address will not be published. Required fields are marked *