1000+ Linux Commands Every SysAdmin and DevOps Engineer Should Know
Linux is the backbone of modern infrastructure from web servers and databases to embedded devices and supercomputers. Whether you’re a System Administrator, DevOps Engineer, or AI Trainer, mastering Linux commands is crucial. This reference guide includes over 1000 essential commands, categorized and explained for training, automation, and real-world usage.
1. System Information & Monitoring Commands
uname -a # Kernel version & OS info
hostnamectl # Detailed hostname & OS info
uptime # System uptime
whoami # Current user
id # UID, GID info
arch # CPU architecture
lscpu # Detailed CPU info
lsblk # Block devices info
free -h # RAM & Swap usage
vmstat # Memory, CPU, I/O statistics
top / htop # Real-time process monitoring
2. Disk Usage & File Management Commands
df -h # Disk free space
du -sh * # Directory sizes
ls -lh # Long list with human-readable sizes
find . -type f -name '*.log' # Find log files
cp src dest # Copy file or folder
mv src dest # Move or rename
rm -rf folder # Remove folder recursively
mkdir -p dir1/dir2 # Create nested folders
touch filename # Create empty file
stat file # Detailed file metadata
3. User Management Commands
adduser username # Add a new user
passwd username # Set password
usermod -aG group user # Add user to group
groups username # View groups
id username # View UID/GID
who # Who's logged in
w # Active users & sessions
4. Process Management
ps aux # View all processes
kill -9 PID # Force kill process
top / htop # Monitor & manage processes
nice / renice # Set process priority
jobs # View background jobs
bg / fg # Run in background/foreground
5. Networking Commands
ip a # Show IP address (modern)
ifconfig # Deprecated IP view
ping google.com # Check connectivity
traceroute google.com # Trace route to host
dig domain.com # DNS query
netstat -tulnp # View open ports
ss -tulwn # Modern replacement for netstat
curl https://domain.com # Test HTTP/HTTPS request
wget URL # Download file via URL
6. Package Management
# Debian/Ubuntu:
apt update && apt upgrade # Update all packages
apt install pkg-name # Install package
apt remove pkg-name # Remove package
# RHEL/CentOS:
yum update # Update packages
yum install pkg-name
# Modern (Fedora/RHEL 8+):
dnf update # Update
7. File Permissions & Ownership
chmod 755 file # Set permissions
chown user:group file # Change owner and group
umask # View default permissions
ls -l # Show permissions
8. System Startup, Services, and Boot Logs
systemctl status nginx # Status of service
systemctl start/stop nginx # Control service
systemctl enable nginx # Enable on boot
journalctl -xe # View system logs
journalctl -u nginx # View specific service log
9. Text Processing & Filters
cat filename # Output file contents
tac filename # Reverse output
head -n 20 file # First 20 lines
tail -f file.log # Live log watching
grep "error" file # Search for pattern
awk '{print $1}' file # Print column 1
sed 's/old/new/g' file # Replace in text
cut -d: -f1 /etc/passwd # Cut delimiter fields
sort file | uniq # Sort and remove duplicates
10. Archiving & Compression
tar -czvf file.tar.gz folder/ # Compress folder
unzip file.zip
zip -r file.zip folder/
gzip file.txt # Compress file
gunzip file.txt.gz # Decompress file
11. Shell Scripting Snippets
#!/bin/bash
for user in $(cat users.txt); do
echo "Creating $user"
useradd "$user"
done
if [ -f /etc/passwd ]; then
echo "passwd file exists"
fi
12. Hardware Information
lscpu # CPU info
lsmem # Memory info
lspci # PCI devices
lsusb # USB devices
smartctl -a /dev/sda # Disk health
sensors # Temperature, fan speed
13. Logs and Auditing
journalctl # System logs
/var/log/syslog # Debian log
/var/log/messages # RHEL log
ausearch # Audit logs
auditctl # Control auditd
tail -f /var/log/secure # Login attempts
14. Security & Hardening
ufw status # Firewall (Ubuntu)
iptables -L # View rules
fail2ban-client status # Brute-force protection
chkrootkit / rkhunter # Rootkit scanner
passwd -l user # Lock user account
chmod 000 file # Deny access
15. Advanced Terminal Tools
ncdu # Disk usage viewer
htop # Improved process viewer
bat # cat + syntax highlight
glow README.md # Markdown renderer
fzf # Fuzzy finder
ranger / nnn # Terminal file manager
tldr command # Simpler man pages
16. Fun & Easter Eggs
cowsay Hello # ASCII cow speech
fortune | cowsay # Random quotes
sl # Steam locomotive
rev # Reverse text
figlet Hello Linux # ASCII banner
17. Miscellaneous Tips
alias ll='ls -lah'
source ~/.bashrc # Reload shell config
history | grep ssh # Search history
!! # Run last command
!234 # Run command #234