🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux Cheat Sheet 2026: 100+ Essential Commands Every SysAdmin and DevOps Engineer Needs

Linux Cheat Sheet 2026: 100+ Essential Commands Every SysAdmin and DevOps Engineer Needs

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

Linux filesystem hierarchy visualization

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:


👤 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:


⚙️ 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

Linux system monitoring and network diagnostics

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:


🛡️ Firewall & Security

Linux firewall and security infrastructure

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:


📦 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:


📊 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:


🐚 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:


📚 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 & Viewing3
Permissions & Users5
Process Management2
Networking3
Firewall & Security4
Systemd & Services3
Disk & Storage2
Text Processing3
Performance & Debugging3
Shell Scripting & Bash3
SSH & Remote Access2
Containers & Virtualization2
Package Management1
Vim / Nano Editors5
Web Servers (Nginx, Apache)4
Guides & Deep Dives6
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:

  1. Linux for Absolute Beginners
  2. Linux Terminal Basics
  3. Linux Command Line Mastery
  4. Linux Administration Fundamentals
  5. Introduction to Linux Shell Scripting
  6. Linux System Administration Handbook
  7. Linux Performance Tuning
  8. Linux Troubleshooting Techniques
  9. 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.

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.