Linux Commands Cheatsheet

File Operations

ls -lahList files with details
cp -r src/ dst/Copy recursively
mv file newnameMove/rename file
rm -rf dir/Remove directory recursively
find . -name '*.log'Find files by name
grep -r 'pattern' .Search file contents
chmod 755 fileSet permissions
chown user:group fileChange ownership
ln -s target linkCreate symlink

Process Management

ps auxList all processes
top / htopInteractive process monitor
kill -9 Force kill process
pkill nginxKill by name
nohup cmd &Run in background
jobs / fg / bgJob control

Networking

ss -tlnpShow listening ports
netstat -tulpnNetwork connections
curl -I https://example.comHTTP headers
wget -O file urlDownload file
scp file user@host:pathSecure copy
ssh -i key.pem user@hostSSH with key

System

df -hDisk usage
du -sh *Directory sizes
free -hMemory usage
uptimeSystem uptime
uname -aSystem info
tail -f /var/log/syslogFollow log file
journalctl -u nginx -fSystemd service logs
systemctl start/stop/restartManage services