Linux Command Line Quick Reference
Linux Command Line
Quick Reference Guide
Essential Commands Every Developer Should Know
By Zeeshan Shaukat | 2026 Edition
Page 1
Linux Command Line Quick Reference
1. File System Navigation
The Linux file system is organized as a hierarchical tree structure with the root directory (/) at
the top. Understanding how to navigate this structure efficiently is the foundation of working with
the command line.
Command Description
pwd Print current working directory
ls -la List all files including hidden, with details
cd /path/to/dir Change to specified directory
cd ~ Go to home directory
cd .. Go up one directory level
cd - Go to previous directory
tree -L 2 Show directory structure, 2 levels deep
find / -name '*.log' Search for files by name pattern recursively
locate filename Fast file search using pre-built database
Page 2
Linux Command Line Quick Reference
2. File Operations
These commands handle creating, copying, moving, and deleting files and directories. Be
careful with rm commands as deletions are permanent in Linux; there is no recycle bin by
default.
Command Description
cp source dest Copy file to destination
cp -r src/ dest/ Copy directory recursively
mv old new Move or rename file/directory
rm filename Delete file permanently
rm -rf directory/ Delete directory and contents recursively
mkdir -p a/b/c Create nested directories
touch [Link] Create empty file or update timestamp
ln -s target link Create symbolic link
chmod 755 file Set file permissions (rwxr-xr-x)
chown user:group file Change file ownership
Page 3
Linux Command Line Quick Reference
3. Text Processing
Linux excels at text processing. These tools can be combined with pipes (|) to create powerful
data processing pipelines. Learning to chain these commands together is one of the most
valuable skills you can develop.
Command Description
cat [Link] Display file contents
head -n 20 [Link] Show first 20 lines
tail -f logfile Follow log file in real time
grep -rn 'pattern' . Search recursively with line numbers
sed 's/old/new/g' file Find and replace text in file
awk '{print $1}' file Print first column of each line
sort -u [Link] Sort and remove duplicates
wc -l [Link] Count lines in file
diff file1 file2 Compare two files line by line
cut -d',' -f1,3 csv Extract columns 1 and 3 from CSV
Page 4
Linux Command Line Quick Reference
4. System Administration
These commands help you monitor system resources, manage processes, and perform
administrative tasks. Most system administration commands require root privileges, so prefix
them with sudo when needed.
Command Description
top / htop Monitor processes and system resources
ps aux List all running processes
kill -9 PID Force kill a process by ID
df -h Show disk space usage (human readable)
du -sh * Show size of each item in current directory
free -h Display memory usage
uptime Show system uptime and load average
journalctl -xe View recent system logs with details
systemctl status svc Check status of a system service
crontab -e Edit scheduled tasks for current user
Page 5
Linux Command Line Quick Reference
5. Networking Commands
Network troubleshooting and configuration commands are essential for any system
administrator or developer. These tools help you diagnose connectivity issues, transfer files,
and manage network interfaces.
Command Description
ping host Test network connectivity to a host
curl -I url Fetch HTTP headers from a URL
wget url Download file from URL
ssh user@host Connect to remote server via SSH
scp file user@host:path Copy file to remote server securely
ip addr show Display network interface addresses
ss -tulpn Show listening ports and processes
nslookup domain DNS lookup for a domain name
traceroute host Trace network path to destination
netstat -an Show all network connections
Page 6
Linux Command Line Quick Reference
6. Package Management and Git
Package managers simplify software installation and updates. The most common are apt
(Debian/Ubuntu), dnf (Fedora/RHEL), and pacman (Arch Linux). Git is the universal version
control system used in nearly all software development.
Essential Git Commands
Command Description
git clone url Clone a remote repository
git status Show current branch and changed files
git add -p Stage changes interactively by chunk
git commit -m 'msg' Commit staged changes with message
git log --oneline -10 Show last 10 commits in compact format
git branch -a List all local and remote branches
git stash / git stash pop Temporarily save and restore changes
git rebase -i HEAD~3 Rewrite last 3 commits interactively
Page 7