The Filesystem · Lesson 1 of 12
Filesystem Hierarchy
0 / 5 checkpoints answered
Linux presents mounted filesystems as one directory tree rooted at /. The Filesystem Hierarchy Standard, or FHS, gives many directories conventional roles, but distributions, containers, immutable systems, and local policy can differ. Inspect the actual host before relying on a path.
$ ls -ld /*
Root and Essential System Paths
/is the root of the visible filesystem tree./etcholds host-specific system configuration. It can contain executable helper or startup scripts, so it is inaccurate to say it never contains executable content./bootholds boot-related files such as boot-loader data and, on many systems, kernels and initial RAM filesystem images./binand/sbintraditionally contain essential user and system-administration commands./liband architecture-specific variants traditionally contain essential shared libraries and loader components.
Many current distributions use a merged /usr layout in which /bin, /sbin, and /lib are symbolic links into corresponding /usr directories. Use command discovery and package records rather than assuming whether a path is a physical directory or link.
CheckWhich directory conventionally contains host-specific system configuration?
press 1/2/3 to answer · → next lesson
Distribution and Local Software
/usrcontains the main shareable, largely read-only operating-system and application hierarchy, including commands, libraries, and architecture-independent data./usr/localis reserved for software and data installed by the local administrator outside the distribution's normal/usrmanagement./optcan hold add-on application packages in self-contained subtrees.
Despite its name, /usr is not where individual users' personal files normally live. Distribution package managers commonly own large parts of it, so copying locally compiled files into /usr/bin can conflict with managed packages.
CheckWhich prefix is conventionally reserved for software installed locally outside distribution-managed /usr content?
press 1/2/3 to answer · → next lesson
User and Service Data
/homeconventionally contains non-root users' home directories, though directory services and local policy can place them elsewhere./rootis the root account's conventional home directory./srvis intended for site-specific data served by this system.
A home path comes from account information, not merely from joining /home with a username. Use getent passwd USER or the shell's resolved home rather than hard-coding assumptions.
CheckWhat is the root account's conventional home directory?
press 1/2/3 to answer · → next lesson
Variable, Runtime, and Temporary Data
/varcontains variable data such as logs, caches, spools, and application state. System logs commonly appear under/var/log, though some systems rely primarily on a journal interface./runcontains volatile runtime state for the current boot, such as sockets, service state, and PID files. It is normally recreated at boot./tmpis for temporary files and is commonly writable by all users with sticky-bit protection./var/tmpis intended for temporary files that should survive longer than files in/tmp.
Cleanup policy for /tmp varies; do not assume files persist until reboot or are always deleted at reboot. Applications should use secure temporary-file creation rather than predictable names.
CheckWhich path conventionally stores system log files?
press 1/2/3 to answer · → next lesson
Devices, Kernel Interfaces, and Mount Points
/devcontains device nodes and related runtime links./procexposes process and kernel interfaces through procfs./sysexposes kernel objects, devices, drivers, and attributes through sysfs./mediais commonly used for automatically mounted removable media./mntis a conventional location for temporary administrator mounts.
These are conventions, not permission grants. Mounting another filesystem on a nonempty directory temporarily hides the directory's previous contents until unmounted.
CheckWhich path normally exposes the kernel device model through sysfs?
press 1/2/3 to answer · → next lesson
Use Navigate the Filesystem in Linux to inspect these paths, and Find Files and Commands in Linux to avoid relying on guessed locations.
Summary
You can now relate major Linux paths to their intended roles while allowing for real system variation.
- Start from the unified tree rooted at
/. - Separate configuration, managed software, local software, and variable data.
- Distinguish homes and service data from runtime state.
- Recognize
/dev,/proc, and/sysas special runtime interfaces. - Inspect symlinks, mounts, account data, and distribution policy before assuming a layout.
Lesson complete
You finished Filesystem Hierarchy. Nice work — keep the momentum going.