Linux Bash Cheatsheet
Essential shell commands for directory operations, process handling, user privileges, networks, and environment variables.
Files & Directory Ops
ls -la
List directory contents in long format, showing hidden files.
ls -la /var/www
mkdir -p [path]
Create a directory recursively including parents if missing.
mkdir -p /var/www/html/assets
chmod 755 [file]
Set file permissions to user read-write-execute, group/others read-execute.
chmod 755 script.sh
rm -rf [path]
Force remove directories and contents recursively.
rm -rf /tmp/cache-old
find [dir] -name [pattern]
Locate files within active directories matching naming patterns.
find /etc -name "*.conf"
Process & Resources
ps aux | grep [proc]
Find active processes matching term.
ps aux | grep apache2
kill -9 [pid]
Force terminate process immediately.
kill -9 1844
df -h
Show disk space usage in human-readable formats.
df -h
free -h
Display system RAM usage metrics.
free -h
Networking & Uptime
curl -I [url]
Fetch headers from a web address to verify server status.
curl -I https://google.com
ping -c 4 [host]
Send ICMP packets to host to measure latency.
ping -c 4 8.8.8.8
netstat -tuln
List all active tcp, udp listening ports on host.
netstat -tuln
ssh [user]@[host]
Establish secure shell sessions with remote servers.
ssh root@192.168.1.50
No matching syntax found
Verify your query spelling or try searching another keyword.