Tutorial 📅 February 17, 2026 📖 20 min read

Linux Commands Cheat Sheet 2026: 100 Essential Commands Every Developer Needs

The ultimate Linux commands reference. 100 essential commands organized by category with practical examples for file management, networking, process control, user permissions, and VPS server administration.

Whether you're managing a VPS, deploying applications, or troubleshooting server issues, knowing the right Linux commands saves hours of work. This cheat sheet covers the 100 most essential commands organized by category, with practical examples you can use immediately.

Bookmark this page - it's your go-to reference for Linux command line operations in 2026.

Don't want to memorize commands? VPS Commander lets you manage your Linux server through a visual web interface. Execute over 400 pre-built workflows without typing a single command. Perfect for developers who want results, not terminal mastery.

File and Directory Commands

These are the most frequently used commands for navigating and managing files on any Linux system.

CommandDescriptionExample
lsList directory contentsls -la /var/www/
cdChange directorycd /etc/nginx/
pwdPrint working directorypwd
mkdirCreate directorymkdir -p /var/www/mysite
rmdirRemove empty directoryrmdir old_folder
cpCopy files or directoriescp -r source/ dest/
mvMove or rename filesmv old.txt new.txt
rmRemove files or directoriesrm -rf /tmp/cache/
touchCreate empty filetouch index.html
findSearch for filesfind / -name "*.log" -size +100M
locateFind files by name (indexed)locate nginx.conf
lnCreate linksln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
treeDisplay directory treetree -L 2 /var/www/
statDisplay file detailsstat index.html

Key Examples

# List all files including hidden, with details
ls -la

# Create nested directories
mkdir -p /var/www/mysite/public/assets

# Copy directory recursively
cp -r /var/www/mysite/ /var/www/mysite-backup/

# Find files modified in the last 24 hours
find /var/log/ -name "*.log" -mtime -1

# Find and delete files older than 30 days
find /tmp/ -type f -mtime +30 -delete
Be careful with rm -rf! The rm -rf command permanently deletes files without confirmation. Always double-check the path before executing, especially when running as root. There is no recycle bin on Linux.

File Content and Text Commands

Commands for viewing, searching, and manipulating file contents - essential for reading logs and configuration files.

CommandDescriptionExample
catDisplay file contentscat /etc/hostname
lessView file with paginationless /var/log/syslog
headShow first N lineshead -20 access.log
tailShow last N linestail -f /var/log/nginx/error.log
grepSearch text patternsgrep -r "error" /var/log/
sedStream editor (find/replace)sed -i 's/old/new/g' file.txt
awkText processingawk '{print $1}' access.log
wcCount lines/words/charswc -l access.log
sortSort file contentssort -rn sizes.txt
uniqRemove duplicate linessort file.txt | uniq -c
diffCompare two filesdiff config.old config.new
nanoSimple text editornano /etc/nginx/nginx.conf
vimAdvanced text editorvim /etc/hosts

Powerful Grep Examples

# Search for errors in all log files
grep -r "error" /var/log/ --include="*.log"

# Case-insensitive search with line numbers
grep -in "failed" /var/log/auth.log

# Show lines before and after match (context)
grep -C 3 "502 Bad Gateway" /var/log/nginx/error.log

# Count occurrences
grep -c "404" /var/log/nginx/access.log

# Exclude patterns
grep -v "bot" access.log | grep "404"

Real-Time Log Monitoring

# Follow log in real time
tail -f /var/log/nginx/access.log

# Follow multiple logs
tail -f /var/log/nginx/access.log /var/log/nginx/error.log

# Follow with grep filter
tail -f /var/log/nginx/access.log | grep "500"
✨Trusted by 1000+ developers worldwide

Skip the commands - manage servers visually

VPS Commander provides 400+ pre-built workflows so you can manage files, view logs, and execute operations without memorizing any commands.

Get started for free Sign in
400+
Automated workflows
1000+
Active users
99.9%
Uptime guarantee

User and Permission Commands

CommandDescriptionExample
chmodChange file permissionschmod 755 script.sh
chownChange file ownershipchown www-data:www-data /var/www/ -R
useraddCreate new useruseradd -m -s /bin/bash deploy
usermodModify userusermod -aG sudo deploy
userdelDelete useruserdel -r olduser
passwdChange passwordpasswd deploy
sudoExecute as superusersudo systemctl restart nginx
suSwitch usersu - deploy
groupsShow user groupsgroups deploy
idShow user/group IDsid deploy
whoamiCurrent usernamewhoami

Permission Reference

# Permission numbers explained:
# 7 = read (4) + write (2) + execute (1) = rwx
# 6 = read (4) + write (2) = rw-
# 5 = read (4) + execute (1) = r-x
# 4 = read only = r--
# 0 = no permissions = ---

# Common permission patterns:
chmod 755 directory/    # Owner: rwx, Group: r-x, Others: r-x
chmod 644 file.html     # Owner: rw-, Group: r--, Others: r--
chmod 600 .env          # Owner: rw-, Group: ---, Others: ---
chmod +x script.sh      # Add execute permission for everyone

System Information Commands

CommandDescriptionExample
uname -aSystem informationuname -a
hostnameShow/set hostnamehostname
uptimeSystem uptimeuptime
dateCurrent date/timedate '+%Y-%m-%d %H:%M:%S'
freeMemory usagefree -h
topProcess monitortop
htopInteractive process viewerhtop
dfDisk space usagedf -h
duDirectory sizedu -sh /var/log/
lscpuCPU informationlscpu
lsb_releaseOS versionlsb_release -a
dmesgKernel messagesdmesg | tail -20

Quick Server Health Check

# One-liner server health check
echo "=== CPU ===" && uptime && echo "=== Memory ===" && free -h && echo "=== Disk ===" && df -h / && echo "=== Load ===" && cat /proc/loadavg

Network Commands

CommandDescriptionExample
pingTest connectivityping -c 4 google.com
curlTransfer data from URLscurl -I https://example.com
wgetDownload fileswget https://example.com/file.zip
ssSocket statisticsss -tulnp
ip addrShow IP addressesip addr show
digDNS lookupdig example.com
nslookupDNS querynslookup example.com
tracerouteTrace network pathtraceroute google.com
scpSecure copy over SSHscp file.txt user@host:/path/
rsyncSync files remotelyrsync -avz /local/ user@host:/remote/
sshSecure shell connectionssh user@192.168.1.100
netstatNetwork statisticsnetstat -tulnp

Useful Networking Examples

# Check which ports are open and listening
ss -tulnp

# Test if a specific port is open
curl -v telnet://localhost:3000

# Download a file and show progress
wget --progress=bar https://example.com/large-file.tar.gz

# Check HTTP response headers
curl -I https://yourdomain.com

# Sync files to remote server (deploy)
rsync -avz --delete ./dist/ user@server:/var/www/mysite/

Process Management

CommandDescriptionExample
psList processesps aux
killKill process by PIDkill -9 1234
killallKill processes by namekillall nginx
systemctlManage systemd servicessystemctl restart nginx
journalctlView systemd logsjournalctl -u nginx -f
bgResume job in backgroundbg %1
fgBring job to foregroundfg %1
nohupRun immune to hangupsnohup ./script.sh &
screenTerminal multiplexerscreen -S mysession
crontabSchedule taskscrontab -e

Essential systemctl Commands

# Manage services
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
sudo systemctl status nginx

# Enable/disable on boot
sudo systemctl enable nginx
sudo systemctl disable nginx

# View all running services
systemctl list-units --type=service --state=running

# View service logs
journalctl -u nginx --since "1 hour ago"
journalctl -u nginx -f  # Follow in real time

Cron Job Schedule Format

# Cron format: minute hour day month weekday command
# ┌───────────── minute (0-59)
# │ ┌───────────── hour (0-23)
# │ │ ┌───────────── day of month (1-31)
# │ │ │ ┌───────────── month (1-12)
# │ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
# * * * * * command

# Examples:
0 2 * * * /usr/local/bin/backup.sh          # Daily at 2:00 AM
*/5 * * * * /usr/local/bin/health-check.sh   # Every 5 minutes
0 0 * * 0 certbot renew                      # Weekly on Sunday midnight
0 */6 * * * /usr/bin/apt update              # Every 6 hours
✨Trusted by 1000+ developers worldwide

Manage servers without memorizing commands

VPS Commander turns complex terminal operations into simple clicks. Monitor resources, manage files, and deploy applications through an intuitive web interface.

Get started for free Sign in
400+
Automated workflows
1000+
Active users
99.9%
Uptime guarantee

Package Management

APT (Ubuntu/Debian)

# Update package lists
sudo apt update

# Upgrade all packages
sudo apt upgrade -y

# Install a package
sudo apt install nginx -y

# Remove a package
sudo apt remove nginx

# Remove package and config files
sudo apt purge nginx

# Search for packages
apt search nodejs

# Show package info
apt show nginx

# Clean up unused packages
sudo apt autoremove -y

Snap Packages

# Install a snap package
sudo snap install node --classic

# List installed snaps
snap list

# Update all snaps
sudo snap refresh

Disk and Storage Commands

CommandDescriptionExample
df -hDisk space in human-readabledf -h
du -shDirectory sizedu -sh /var/log/
lsblkList block deviceslsblk
mountMount filesystemmount /dev/sdb1 /mnt/data
umountUnmount filesystemumount /mnt/data
fdiskPartition managementfdisk -l
tarArchive filestar -czf backup.tar.gz /var/www/
zip/unzipCompress/decompresszip -r archive.zip folder/
gzipCompress filesgzip large-file.log

Find Large Files and Directories

# Find top 10 largest files
find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -10

# Find top 10 largest directories
du -h --max-depth=1 / 2>/dev/null | sort -rh | head -10

# Check disk usage by directory
du -sh /var/* | sort -rh

# Find files larger than 100MB
find / -type f -size +100M -exec ls -lh {} \;

VPS Management Commands

These commands are specifically useful for managing VPS servers day-to-day. For a complete deployment guide, see our website deployment tutorial.

Nginx Management

# Test configuration
sudo nginx -t

# Reload without downtime
sudo systemctl reload nginx

# View access logs
tail -f /var/log/nginx/access.log

# View error logs
tail -f /var/log/nginx/error.log

# List enabled sites
ls -la /etc/nginx/sites-enabled/

Firewall (UFW)

# Check status
sudo ufw status verbose

# Allow a port
sudo ufw allow 8080

# Allow specific IP
sudo ufw allow from 192.168.1.100

# Deny a port
sudo ufw deny 3306

# Delete a rule
sudo ufw delete allow 8080

# Reset all rules
sudo ufw reset

SSL Certificate Management

# Install Certbot
sudo apt install certbot python3-certbot-nginx -y

# Get SSL certificate
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

# Renew all certificates
sudo certbot renew

# Check certificate status
sudo certbot certificates

# Test auto-renewal
sudo certbot renew --dry-run

Server Backup

# Full website backup
tar -czf /backups/website-$(date +%Y%m%d).tar.gz /var/www/

# Database backup (MySQL)
mysqldump -u root -p mydb > /backups/db-$(date +%Y%m%d).sql

# Database backup (PostgreSQL)
pg_dump mydb > /backups/db-$(date +%Y%m%d).sql

# Sync backup to remote server
rsync -avz /backups/ user@backup-server:/backups/
Want to manage all this without commands? VPS Commander provides visual tools for file management, log viewing, server monitoring, and 400+ pre-built workflows. Deploy applications, manage SSL certificates, and configure firewalls - all through a web interface. Learn more about terminal-free VPS management.

Frequently Asked Questions

What are the most important Linux commands to learn first?

Start with ls, cd, cp, mv, rm, cat, grep, sudo, chmod, and systemctl. These 10 commands cover 80% of daily tasks. Then expand to networking and process management commands.

How do I find which process is using a specific port?

Use ss -tulnp | grep :PORT or lsof -i :PORT. For example, ss -tulnp | grep :80 shows what's using port 80. This is essential for debugging port conflicts.

How do I check server resource usage?

Use htop for an interactive view, free -h for memory, df -h for disk space, and uptime for CPU load averages. For a quick overview, combine them in a single command.

What's the difference between rm and rm -rf?

rm deletes individual files. rm -r deletes directories recursively. rm -rf forces deletion without confirmation. Always double-check paths before using rm -rf as it cannot be undone.

How do I make a script executable?

Use chmod +x script.sh to add execute permission, then run it with ./script.sh. For system-wide access, move the script to /usr/local/bin/.

Conclusion

This Linux commands cheat sheet covers the 100 most essential commands you'll need for daily server management. Bookmark this page and refer back to it whenever you need a quick reference.

Remember: you don't need to memorize every command. Tools like VPS Commander can handle most server management tasks through a visual interface. But knowing these commands gives you the power to handle any situation that comes up.

Keep Learning: Check out our guides on deploying websites on a VPS, securing your VPS server, and getting started with Docker.

Related Articles