#Why this matters
Most production servers, cloud containers, and cybersecurity lab machines run Linux without a graphical desktop. Whether you are triaging an alert on a web server or solving a beginner wargame challenge, your first minutes depend on knowing where you are, where the operating system stores configuration and logs, and how to find a file without guessing.
#The shell prompt and paths
When you open a terminal, you interact with a shell -- usually Bash (Bourne Again SHell). A typical prompt looks like student@lab:~$, showing your username (student), hostname (lab), current folder (~, shorthand for your home directory), and privilege symbol ($ for a normal user, # for root).
Every command resolves filenames relative to your working directory, which you print with pwd and change with cd:
- Absolute paths always begin at the top of the tree (
/), socd /var/logworks from anywhere. - Relative paths start from where you stand now. A single dot (
.) means the current directory, double dot (..) means the parent directory, and~expands to your home directory (such as/home/student).
#The Filesystem Hierarchy Standard (FHS)
Unlike Windows, which splits storage across drive letters (C:\, D:\), Linux mounts everything under a single root directory /. The Filesystem Hierarchy Standard (FHS) keeps layouts predictable across distributions.
| Directory | Purpose | Security and admin relevance |
|---|---|---|
/ |
Root of the entire tree | Starting point for all absolute paths |
/home |
Personal directories for normal users | User scripts, SSH keys (~/.ssh), challenge files |
/root |
Home directory of the root account |
Restricted admin workspace |
/etc |
Host-specific system configuration | Service configs, /etc/passwd, /etc/ssh/sshd_config |
/var/log |
Variable log files written by services | Authentication logs, web access logs, audit trails |
/tmp |
Temporary files shared by users | Writable by all users; common spot for scratch files |
/bin, /usr/bin |
Essential and user command binaries | Standard tools (ls, grep, find) |
/proc |
Virtual filesystem of running processes | Live kernel and process metadata in RAM |
Note that on modern distributions such as Ubuntu and Debian, /bin is often a symbolic link to /usr/bin, so both paths lead to the same standard binaries.
#Listing, inspecting, and searching files
Before opening an unfamiliar file, list the directory and check what kind of file it is. On Linux, file extensions like .txt or .log are only conventions; the kernel and file command inspect the actual file header (magic bytes).
$ pwd
/home/student
$ ls -la /home/student/wargame
total 16
drwxr-xr-x 3 student student 4096 Nov 10 09:00 .
drwxr-xr-x 5 student student 4096 Nov 10 08:55 ..
drwxr-x--- 2 student student 4096 Nov 10 09:00 .vault
-rw-r--r-- 1 student student 218 Nov 10 09:00 README.txt
-rwxr-xr-x 1 student student 14648 Nov 10 09:00 helper.bin
$ file /home/student/wargame/helper.bin /home/student/wargame/README.txt
/home/student/wargame/helper.bin: ELF 64-bit LSB pie executable, x86-64
/home/student/wargame/README.txt: ASCII text
$ find /home/student/wargame -type f -name "*.conf" 2>/dev/null
/home/student/wargame/.vault/service.conf
$ grep -rn "TOKEN=" /home/student/wargame/.vault
/home/student/wargame/.vault/service.conf:4:TOKEN=lab_demo_9481Key flags to remember:
ls -la:-lprints long metadata (permissions, owner, size, timestamp) and-areveals hidden dotfiles starting with..file <path>: identifies ASCII text, shell scripts, archives, or compiled ELF binaries before you print them.find <start> -type f -name "<pattern>": walks subdirectories recursively. Appending2>/dev/nullhides "Permission denied" noise when searching shared system trees.grep -rn "<text>" <path>: searches inside files recursively (-r) and prints matching line numbers (-n); add-ifor case-insensitive matching.
- Orientpwd and ls -la
- Locatefind by name or type
- Inspectfile before cat or less
- Searchgrep -rn inside text files
#Common mistakes
- Mixing up relative and absolute paths: Typing
cd etcwhile inside/home/studentfails because there is noetcsubfolder there; system configuration lives at/etcwith a leading slash. - Running
caton binary files: Printing an executable or compressed archive can lock or scramble your terminal display. Check withfilefirst and uselessfor long text files. - Missing hidden dotfiles: Plain
lshides entries beginning with.. Attackers and wargame authors frequently place notes or scripts inside hidden directories such as.cacheor.vault. - Searching
/blindly: Runningfind /without narrowing the starting directory (/etc,/var/log,/home) wastes time and floods output with/procerrors.
#Summary
Linux organizes every file under a single / root following the Filesystem Hierarchy Standard, with configuration in /etc, logs in /var/log, user data in /home, and shared scratch space in /tmp. Navigating accurately with pwd, cd, and absolute or relative paths prevents you from editing or inspecting the wrong file. Combining ls -la, file, find, and grep gives you a repeatable workflow to uncover hidden files and text indicators safely.