Ask any experienced sysadmin what tool they reach for most often, and the answer is always the same: the command line. No GUI, no dashboard, no cloud console comes close to the speed and precision of a well‑crafted Linux command.
The problem? There are thousands of commands, flags, and options. Nobody memorizes them all. That is where a good cheat sheet becomes your most valuable piece of infrastructure.
This guide organizes the 100+ most essential Linux commands for 2026 into practical categories. Each section links to our free downloadable cheat sheet PDFs for that topic — 51 Linux reference guides in total, ready to print or pull up on your second monitor.
📁 File Management & Navigation
Everything in Linux is a file. Mastering file operations is non‑negotiable.
Navigation
pwd # Print working directory
ls -lah # List all files with human-readable sizes
cd /var/log # Change directory
cd - # Return to previous directory
tree -L 2 # Show directory tree, 2 levels deep
File Operations
cp -r source/ dest/ # Copy directory recursively
mv oldname newname # Move or rename
rm -rf /tmp/cache/ # Remove recursively (use with caution!)
mkdir -p a/b/c # Create nested directories
ln -s /target link # Create symbolic link
find / -name "*.log" -mtime -7 # Find log files modified in last 7 days
locate filename # Fast file search (uses database)
stat file.txt # Detailed file metadata
File Viewing & Searching
cat file.txt # Display entire file
less file.txt # Page through file (better for large files)
head -n 20 file.txt # First 20 lines
tail -f /var/log/syslog # Follow log in real-time
grep -rn "error" /var/log/ # Recursive search with line numbers
grep -E "warn|error|fail" log.txt # Extended regex search
wc -l file.txt # Count lines
diff file1 file2 # Compare files
📥 Download the complete reference:
- Linux Commands: File Management (Part 1)
- Linux Commands: File Management (Part 2)
- Linux Commands: File Viewing & Searching
👤 User & Permission Management
Multi‑user environments demand precise access control. These commands keep your system secure.
User Management
useradd -m -s /bin/bash newuser # Create user with home dir
usermod -aG sudo newuser # Add user to sudo group
userdel -r olduser # Remove user and home directory
passwd username # Set/change password
id username # Show user UID, GID, groups
who # Currently logged-in users
last # Login history
Permissions & Ownership
chmod 755 script.sh # rwxr-xr-x (owner full, others read+exec)
chmod u+x file # Add execute for owner
chown user:group file # Change ownership
chown -R www-data: /var/www/ # Recursive ownership change
umask 022 # Set default permissions for new files
getfacl file # View ACL permissions
setfacl -m u:user:rw file # Set ACL for specific user
📥 Download the complete reference:
- Linux Commands: Permissions & Ownership
- Linux Commands: User Management (Part 1)
- Linux Commands: User Management (Part 2)
- Linux File Permissions Complete Guide 2026
⚙️ Process Management
Knowing what is running on your system — and how to control it — is a core sysadmin skill.
ps aux # List all processes with details
ps aux | grep nginx # Find specific process
top # Interactive process viewer
htop # Better interactive viewer (if installed)
kill PID # Send SIGTERM to process
kill -9 PID # Force kill (SIGKILL)
killall nginx # Kill all processes by name
pkill -f "python app" # Kill by pattern match
nohup command & # Run process immune to hangups
jobs # List background jobs
bg %1 # Resume job in background
fg %1 # Bring job to foreground
nice -n 10 command # Start with lower priority
renice -n 5 -p PID # Change running process priority
pstree # Show process tree
lsof -i :80 # List processes using port 80
📥 Download the complete reference:
🌐 Networking
From troubleshooting DNS to configuring firewalls, networking commands are where sysadmins spend a significant chunk of their time.
Network Diagnostics
ip addr show # Show all interfaces and IPs
ip route show # Display routing table
ss -tulnp # List all listening ports with PIDs
ping -c 4 google.com # Test connectivity
traceroute host # Trace packet route
dig example.com # DNS lookup
nslookup example.com # Alternative DNS lookup
curl -I https://example.com # Fetch HTTP headers
wget -q -O- url # Download to stdout
mtr google.com # Combined ping + traceroute
tcpdump -i eth0 port 443 # Capture packets on port 443
netstat -rn # Routing table (legacy but useful)
Network Configuration
ip link set eth0 up # Enable interface
ip addr add 10.0.0.5/24 dev eth0 # Add IP address
hostnamectl set-hostname server01 # Set hostname
nmcli con show # NetworkManager connections
nmcli con up "Wired 1" # Activate connection
resolvectl status # DNS resolver status (systemd-resolved)
📥 Download the complete reference:
- Linux Commands: Networking (Part 1)
- Linux Commands: Networking (Part 2)
- Linux Commands: Networking (Part 3)
🛡️ Firewall & Security
Security is not a feature — it is a requirement. These commands form your first line of defense.
Firewall (nftables / iptables)
# nftables (modern)
nft list ruleset # Show all rules
nft add rule inet filter input tcp dport 22 accept # Allow SSH
# iptables (legacy, still widely used)
iptables -L -n -v # List rules with counters
iptables -A INPUT -p tcp --dport 443 -j ACCEPT # Allow HTTPS
iptables -A INPUT -j DROP # Default deny
# UFW (Ubuntu simplified firewall)
ufw enable # Enable firewall
ufw allow 22/tcp # Allow SSH
ufw status verbose # Show rules
SSH Security
ssh-keygen -t ed25519 -C "user@host" # Generate modern SSH key
ssh-copy-id user@server # Deploy public key
ssh -i ~/.ssh/key user@server # Connect with specific key
sshd -t # Validate sshd_config syntax
Auditing & Hardening
lastlog # Last login for all users
faillog -a # Failed login attempts
auditctl -l # List audit rules
ausearch -m LOGIN --success no # Failed logins via audit
chkrootkit # Scan for rootkits
lynis audit system # Full security audit
📥 Download the complete reference:
- Linux Commands: Firewall & Security (Part 1)
- Linux Commands: Firewall & Security (Part 2)
- nftables Complete Guide 2026
- Linux Commands: SSH & Remote
📦 Package Management
Every distribution has its own package manager. Here are the essentials for the big three:
APT (Debian / Ubuntu)
apt update && apt upgrade # Update package lists and upgrade
apt install nginx # Install package
apt remove --purge nginx # Remove with config files
apt search keyword # Search repositories
apt list --upgradable # List available upgrades
dpkg -l | grep nginx # Check if installed
DNF / YUM (RHEL / Fedora / AlmaLinux)
dnf check-update # Check for updates
dnf install httpd # Install package
dnf remove httpd # Remove package
dnf search keyword # Search repositories
dnf history # View transaction history
dnf history undo last # Rollback last transaction
Pacman (Arch Linux)
pacman -Syu # Full system upgrade
pacman -S package # Install package
pacman -Rs package # Remove with dependencies
pacman -Ss keyword # Search packages
📥 Download: Linux Commands: Package Management cheat sheet
🔧 Systemd & Service Management
Systemd runs on virtually every modern Linux distribution. These commands are daily essentials.
systemctl start nginx # Start service
systemctl stop nginx # Stop service
systemctl restart nginx # Restart service
systemctl reload nginx # Reload config without restart
systemctl enable nginx # Start on boot
systemctl disable nginx # Don't start on boot
systemctl status nginx # Service status with recent logs
systemctl is-active nginx # Quick active check
systemctl list-units --failed # List failed services
systemctl daemon-reload # Reload unit files after editing
# Journalctl (log viewing)
journalctl -u nginx -f # Follow service logs
journalctl --since "1 hour ago" # Recent logs
journalctl -p err -b # Errors since last boot
journalctl --disk-usage # Log storage usage
📥 Download the complete reference:
💾 Disk & Storage
Running out of disk space at 3 AM is a rite of passage. These commands help you avoid — or survive — that moment.
df -h # Filesystem disk usage
du -sh /var/log/* # Size of each item in directory
du -sh --max-depth=1 / # Top-level directory sizes
lsblk # Block device tree
fdisk -l # List partitions
blkid # Show UUIDs and filesystem types
mount /dev/sdb1 /mnt # Mount a partition
umount /mnt # Unmount
mkfs.ext4 /dev/sdb1 # Create ext4 filesystem
resize2fs /dev/sda1 # Resize ext filesystem
lvm lvs # List logical volumes
ncdu / # Interactive disk usage analyzer
📥 Download the complete reference:
📝 Text Processing
Text processing is Linux's superpower. These tools turn raw log files into actionable intelligence.
# grep - Pattern matching
grep -c "error" access.log # Count matches
grep -v "debug" app.log # Exclude pattern
grep -A3 -B1 "CRITICAL" syslog # Context around match
# awk - Column processing
awk '{print $1, $7}' access.log # Print columns 1 and 7
awk -F: '{print $1}' /etc/passwd # List all usernames
awk '$9 >= 500' access.log # Filter by status code
# sed - Stream editing
sed 's/old/new/g' file.txt # Global find and replace
sed -i '10,20d' file.txt # Delete lines 10-20 in-place
sed -n '5,10p' file.txt # Print lines 5 through 10
# sort & uniq
sort file.txt | uniq -c | sort -rn # Frequency count
cut -d: -f1 /etc/passwd | sort # Sorted user list
# xargs - Build commands from input
find . -name "*.tmp" | xargs rm # Delete matching files
cat urls.txt | xargs -P4 curl -O # Parallel downloads
📥 Download the complete reference:
- Linux Commands: Text Processing (Part 1)
- Linux Commands: Text Processing (Part 2)
- Linux Commands: Text Processing (Part 3)
📊 Performance & Debugging
uptime # System load averages
free -h # Memory usage
vmstat 1 5 # Virtual memory stats (5 samples)
iostat -xz 1 # Disk I/O statistics
sar -u 1 5 # CPU utilization history
strace -p PID # Trace system calls
dmesg | tail -20 # Kernel ring buffer (recent)
sysctl -a | grep vm # Kernel parameters
perf top # CPU profiling (real-time)
📥 Download the complete reference:
- Linux Commands: Performance & Debugging (Part 1)
- Linux Commands: Performance & Debugging (Part 2)
- Linux Commands: Logging & Monitoring
🐚 Shell Scripting Essentials
#!/bin/bash
# Variables
NAME="server01"
COUNT=$(ls /var/log/*.log | wc -l)
# Conditionals
if [ -f /etc/nginx/nginx.conf ]; then
echo "Nginx config exists"
fi
# Loops
for host in web01 web02 web03; do
ssh $host uptime
done
# Functions
check_disk() {
usage=$(df -h / | awk 'NR==2{print $5}' | tr -d '%')
[ $usage -gt 90 ] && echo "WARNING: Disk usage at ${usage}%"
}
# Error handling
set -euo pipefail # Exit on error, undefined vars, pipe failures
📥 Download the complete reference:
- Linux Commands: Shell Scripting (Part 1)
- Linux Commands: Shell Scripting (Part 2)
- Bash Advanced Guide
📚 All 51 Linux Cheat Sheets — Free Download
Every command in this article comes from our library of 51 Linux‑focused cheat sheets. Here is the full list, organized by topic:
| Topic | Sheets |
|---|---|
| File Management & Viewing | 3 |
| Permissions & Users | 5 |
| Process Management | 2 |
| Networking | 3 |
| Firewall & Security | 4 |
| Systemd & Services | 3 |
| Disk & Storage | 2 |
| Text Processing | 3 |
| Performance & Debugging | 3 |
| Shell Scripting & Bash | 3 |
| SSH & Remote Access | 2 |
| Containers & Virtualization | 2 |
| Package Management | 1 |
| Vim / Nano Editors | 5 |
| Web Servers (Nginx, Apache) | 4 |
| Guides & Deep Dives | 6 |
| TOTAL | 51 |
Browse All 51 Linux Cheat Sheets →
Go Deeper: The Linux Mastery Bundle
Cheat sheets give you speed. Books give you depth. Our Linux Mastery Bundle pairs perfectly with these reference guides — 9 comprehensive eBooks taking you from absolute beginner to professional Linux administrator:
- Linux for Absolute Beginners
- Linux Terminal Basics
- Linux Command Line Mastery
- Linux Administration Fundamentals
- Introduction to Linux Shell Scripting
- Linux System Administration Handbook
- Linux Performance Tuning
- Linux Troubleshooting Techniques
- Linux System Administration Masterclass
Get the Linux Mastery Bundle — €49.90 (49% off) →
9 books. €5.54 per book. From zero to professional sysadmin.
Bookmark this page, download the sheets you need today, and keep building. The command line rewards those who practice.