The directory tree and moving around (absolute and relative paths)
You get to know the file system hierarchy (FHS) in depth, learn the /bin and /usr/bin merge, the difference between /tmp and /var/tmp and where software is installed, use the ~ and ~user shortcuts, the pushd/popd directory stack, relative paths and tree views; at the end you find a lost note in a deep archive and write the relative path between two folders yourself. The paths differ in every lab.
Level 101 · 45 min
Daniel asks you to map the server for an incident review: "Where does evidence live, where are programs installed, where do temporary files land? If you don’t know that, you won’t find the file an attacker left either."
The folder layout on Linux isn’t random: it follows a standard called FHS (Filesystem Hierarchy Standard). That is why the layout you learn on a Debian server is largely the same on Red Hat or inside a container. The figure sums up what the main directories are for.
Analogy: the FHS is like a hospital floor plan. Whichever hospital you go to, the emergency entrance is on the ground floor, the operating theatres upstairs and the archive in the basement. Someone who knows the plan finds their way in a building they have never seen.
What you will do in this lesson
- Shortcuts at the root: /bin → /usr/bin
- /tmp and /var/tmp
- Where are programs installed?
- Homes: ~ and ~user
- The directory stack: pushd, popd, dirs
- A relative path drill
- Tree views: tree and find
- The note lost in the archive
- The relative path between two folders
- Short quiz
Skills you will earn
- Knowing the Linux file system tree (/etc, /var/log, /home, /srv)
- Going back home (cd, ~)
- The ~ and ~user shortcuts
- Using the directory stack (pushd, popd, dirs)
- Moving with relative paths and ..
- Viewing a folder tree (tree, find -maxdepth)
← Short task: work out an unfamiliar command using only its manual · Linux fundamentals · Knowing your files: ls, hidden files, types →
Start for free