Linux

Filesystem Hierarchy (FHS)

20 flashcards · answers and spaced-repetition review in the KnowCard app

You move a script from an Ubuntu box to an obscure embedded distro and it can't find a binary at a hardcoded path. Why is assuming exact directory locations across Linux systems risky, and what standard is supposed to reduce that risk?
On a modern distribution you run ls -l /bin and see it points somewhere else instead of being a real directory of binaries. What happened to the historic /bin vs /usr/bin split?
What distinguishes the intended contents of /boot from those of /etc, and which one typically also stores the kernel?
After a reboot, entries under /dev look freshly rebuilt rather than persisted from last session. Why do device files behave this way, and what creates them?
Where does a modern distribution keep dynamically loadable kernel modules, and what has happened to /lib as a top-level directory?
You find stray numbered files sitting in /lost+found after an unclean shutdown. What put them there, and on which filesystems does this directory even exist?
A junior admin wants to delete some subdirectories under /proc to free disk space. Why is that a category error?
Runtime PID and locking files for system services keep disappearing on reboot and you notice /var/run and /var/lock no longer hold them. Where did they move, and why do they not survive a reboot?
Both /proc and /sys present themselves as directory trees but back onto no disk files. What does /sys expose, and what everyday role does /tmp play by contrast?
When deciding whether a directory can safely go on a read-only or rarely-changing partition, what is the fundamental split between /usr and /var?
You compile a tool from source yourself instead of installing a distro package. Under /usr, which subdirectory is the intended home for it, and how does that differ from /usr/bin and /usr/sbin?
You're compiling a C program from source on Linux. Which /usr subdirectories supply the header files it #includes and the libraries plus toolchain the compiler pulls in?
Two /usr subdirectories hold, respectively, processor-independent data plus documentation, and the source code of Linux itself. Which are they?
Almost every Linux config file lives under /etc, but larger subsystems get their own subdirectory. Which /etc subdirectories point you to cron, systemd, the old Init-V scripts, and distro-specific defaults?
A regular user and root both log in — where does each one's personal home directory live, and how do they differ?
Windows uses drive letters like C: and D: for separate disks. How does Linux instead make several independent filesystems reachable, and where do external media show up?
The FHS reserves /opt for a specific purpose, yet you rarely find much in it on common distributions. What is it for, and why is it underused?
You're a normal user and a command under /sbin (or /usr/sbin) refuses to run for you. What do the programs in these directories have in common?
On a Fedora or RHEL server, where does the FHS suggest keeping the actual data served by your web or FTP daemon?
Given that /var is the home for files a running system constantly changes, which subdirectories would you expect to find, and what does each hold?

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play