Linux & Bash
Essential terminal commands for Linux/macOS
DevOps
Navigation
pwdPrint working directory
cd <dir>Change directory
cd ..Go up one level
cd ~Go to home directory
lsList files
ls -laList all with details
File Operations
cp <src> <dest>Copy file
cp -r <src> <dest>Copy directory
mv <src> <dest>Move or rename
rm <file>Remove file
rm -rf <dir>Remove directory
mkdir <dir>Create directory
touch <file>Create empty file
File Content
cat <file>Display file content
head -n 10 <file>First 10 lines
tail -n 10 <file>Last 10 lines
tail -f <file>Follow file updates
less <file>View with pagination
grep 'pattern' <file>Search in file
Permissions
chmod 755 <file>Set permissions
chmod +x <file>Make executable
chown user:group <file>Change owner
sudo <cmd>Run as superuser
Process Management
ps auxList all processes
topMonitor processes
kill <pid>Kill process by ID
killall <name>Kill by name
bgRun job in background
fgBring to foreground
nohup <cmd> &Run immune to hangups
Network
curl <url>Make HTTP request
wget <url>Download file
ping <host>Test connectivity
netstat -tulpnList open ports
ssh user@hostSSH connection
scp <file> user@host:Secure copy