๐ง Linux Cheat Sheet

Level: Beginner โ Intermediate
Use: DevOps, Cloud, System Admin, Interviews
๐งฐ Essential Linux Commands
Command | Description |
ls -l | List files with details |
cd /path | Change directory |
pwd | Show current path |
cp src dest | Copy files |
mv src dest | Move/rename |
rm file | Remove file |
mkdir folder | Create directory |
find . -name "*.log" | Find files |
grep "text" file | Search inside files |
cat file | View content |
less file | Scroll through file |
df -h | Disk usage |
free -m | RAM usage |
top / htop | System monitor |
ps aux | Show running processes |
kill PID | Kill process by PID |
chmod +x file | Make file executable |
chown user:group file | Change ownership |
๐ Networking Commands
Command | Description |
ping google.com | Check internet |
curl url | Get webpage/API |
wget url | Download file |
scp file user@ip:/path/ | Secure copy |
ssh user@ip | SSH into server |
ip a or ifconfig | View IP address |
๐ฆ Package Management (Ubuntu)
Command | Description |
sudo apt update | Update package list |
sudo apt upgrade | Upgrade packages |
sudo apt install name | Install package |
sudo apt remove name | Remove package |
๐ฅ System Services
Command | Description |
systemctl status nginx | Check status |
systemctl start/stop nginx | Start/stop service |
systemctl enable nginx | Start on boot |
journalctl -u nginx | View logs |
๐ Log Management
Command | Description |
cd /var/log | System logs directory |
tail -n 50 file | Last 50 lines |
tail -f file | Live log follow |
grep "ERROR" file | Filter logs |
awk '{print $1}' file | Print 1st column |
sed 's/old/new/' file | Replace text |
Subscribe to my newsletter
Read articles from Dheeraj Parihar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
