This note explains how to think about the Linux filesystem, paths, and the basic idea of the filesystem hierarchy standard. The goal is to make file locations and system layout feel more logical.
Why this matters
many Linux tasks depend on knowing where files usually live
troubleshooting gets much easier when paths feel predictable
package, config, logs, and data all become easier to reason about with a filesystem model
Environment / Scope
Item
Value
Topic
filesystem hierarchy basics
Best use for this note
building Linux path awareness
Main focus
common directories, config, logs, user space
Safe to practise?
yes
Key concepts
Path - the location of a file or directory
Absolute path - full path from /
Relative path - path from the current working directory
FHS - a common model for where Linux system files tend to live
Mental model
Think about the filesystem like this:
Area
Typical role
/home
user files and home directories
/etc
system configuration
/var
variable data such as logs and state
/usr
installed userland software and shared resources
/tmp
temporary files
The exact distro details can vary, but the model is still very useful.
Everyday examples
Situation
Why this note helps
need to find a config file
/etc becomes a strong first guess
need to review logs
/var/log becomes easier to remember
need to understand app data location
path role is easier to reason about
script fails because of wrong path assumption
absolute vs relative path awareness helps
Common misunderstandings
Misunderstanding
Better explanation
”Linux file layout is random”
it has a pattern even when distros differ in details
”Everything important lives in /home”
system config, logs, and software live elsewhere
”Relative path is good enough everywhere”
automation and admin work often need clearer path handling
”If the file exists somewhere, the exact location does not matter”
location often tells you the file’s role
Verification
Check
Expected result
Common directories feel recognisable
/etc, /var, /home, and /usr have clear roles
Path choice is clearer
file location guesses improve
Troubleshooting feels faster
config and logs are easier to find
Script path handling improves
fewer wrong assumptions about current directory
Pitfalls / Troubleshooting
Problem
Likely cause
What to check
Config file cannot be found
wrong path assumptions
likely config location
Script works only from one directory
weak path handling
relative vs absolute path
Logs are hard to locate
unclear understanding of variable data
/var and app-specific log paths
File role is confusing
path context ignored
what directory it lives in
Key takeaways
Linux paths become much easier when you think in directory roles
config, logs, binaries, and user files usually live in different areas for a reason
path awareness is one of the fastest ways to improve Linux confidence