Navigating the GNU Linux Filesystem
Navigating the GNU Linux Filesystem
Learn how to navigate the GNU Linux filesystem.
Essential Commands
ls - List Directory Contents
ls # List files in current directory
ls -l # Long format with details
ls -a # Show hidden files (starting with .)
ls -la # Combine long format and hidden files
ls /path # List specific directory
cd - Change Directory
cd /home # Go to absolute path
cd Documents # Go to relative path
cd .. # Go up one directory
cd ~ # Go to home directory
cd - # Go to previous directory
pwd - Print Working Directory
pwd # Show current location
The Linux Directory Structure
Key Directories
/- Root of the entire filesystem/home- User home directories/root- Root user's home/etc- System configuration files/var- Variable data (logs, databases)/tmp- Temporary files/usr- User programs and data/bin- Essential binaries/sbin- System binaries/dev- Device files/proc- Process information/sys- System information
Path Types
Absolute Paths
Start from root (
/):/home/user/Documents/file.txt
Relative Paths
Start from current directory:
./script.sh # Current directory
../other/file # Up one, then down
Documents/file # Down from current
Tips
.. to go up directories.Full Blog
For an interactive 3D visualization: https://www.hackers-game.com/2021/03/08/gnu-linux-filesystem-in-3d/