Skip to main content
Linux organizes all files under a single root directory (/), following the Filesystem Hierarchy Standard (FHS) — a convention that defines where different types of files live. Unlike Windows, which assigns drive letters to separate storage volumes, Linux mounts everything into one unified tree. Understanding where configuration files, binaries, logs, and user data reside helps you find what you need quickly and avoid making changes in the wrong place.

Key Directories

DirectoryPurpose
/Root of the entire filesystem; every path starts here
/homePersonal directories for regular users (e.g., /home/alice)
/etcSystem-wide configuration files
/varVariable data: logs, databases, mail spools, caches
/tmpTemporary files; cleared on reboot
/usrUser-space programs, libraries, and documentation
/binEssential user binaries (ls, cp, mv, etc.)
/sbinSystem administration binaries (fdisk, iptables, etc.)
/optOptional third-party software packages
/devDevice files representing hardware (disks, terminals, etc.)
/procVirtual filesystem exposing kernel and process information
/sysVirtual filesystem for hardware and driver configuration
Use these commands to move around and inspect the directory tree.
pwd           # print current directory
ls -la        # list with details and hidden files
cd /etc       # change directory
cd ~          # go to home directory
cd ..         # go up one level
Run ls -lah to display file sizes in human-readable format (KB, MB, GB) alongside the standard long listing.

File Operations

Copy, move, rename, delete, and create files and directories with these essential commands.
cp source.txt dest.txt
mv oldname.txt newname.txt
rm file.txt
rm -rf directory/
mkdir -p path/to/new/dir
touch newfile.txt
rm -rf permanently deletes files and directories without sending them to a trash folder. Double-check your path before running it, especially as root.

Searching for Files

Linux provides several tools for locating files across the filesystem.
find /etc -name "*.conf"
find /var/log -type f -mtime -7
locate filename
which bash
1

Use find for precise searches

find searches the live filesystem in real time. Combine flags like -name, -type, -size, and -mtime to narrow results.
2

Use locate for fast lookups

locate queries a pre-built index for near-instant results. Run sudo updatedb first to refresh the index if the file was recently created.
3

Use which to find executables

which shows the full path of a command as resolved from your $PATH, useful for confirming which version of a program will run.
Every command on Linux has a built-in manual page. Run man ls, man find, or man followed by any command name to read the full documentation directly in your terminal.