Linux Cheat Sheet
Linux Cheat Sheet
3. Process Management
Command Use Case
ps Show running processes
top Dynamic real-time view of processes
htop Advanced version of top (interactive)
kill Kill a process by PID
killall Kill a process by name
nice / Change process priority
renice
4. User Management
Command Use Case
whoami Show current user
id Display UID, GID, and groups
adduser / Create new users
useradd
passwd Change a user's password
su Switch to another user
sudo Run command as superuser
6. Disk Usage
Command Use Case
df -h Show disk space usage in human-readable format
du -sh Show directory size
mount Mount a filesystem
umount Unmount a filesystem
7. Networking
Command Use Case
ip addr / ifconfig Show IP address and network interfaces
ping Test connectivity
netstat -tuln Show open ports and listening services
ss -tuln Faster version of netstat
curl Make HTTP requests
wget Download files via HTTP
traceroute Show the path packets take to a destination
nslookup Resolve domain names to IP
dig Detailed DNS lookup
hostname Show or set the hostname
8. Package Management
Command (Ubuntu/Debian) Use Case
apt update Update package list
apt upgrade Upgrade all packages
apt install <pkg> Install a package
apt remove <pkg> Remove a package
Command (RHEL/CentOS)
yum install <pkg> Install package
dnf install <pkg> Newer Fedora-based systems
Linux Commands Cheat Sheet for DevOps