๐Ÿง Linux Commands โ€” the essentials

Hackbydoing Academy cheat sheet ยท linux ยท terminal ยท files ยท permissions

Files & folders

ls -laList everything, including hidden (dot) files
cd <dir> / cd .. / cd ~Move into a folder / up one / home
pwdPrint where you are (working directory)
cat <file>Print a file to the screen
less <file>Read a file page by page (q quits)
cp / mv / rm <file>Copy / move / delete โ€” rm has no undo
find / -name "*.txt" 2>/dev/nullFind files by name across the whole disk, hiding permission errors
grep -r "text" <dir>Search file CONTENTS recursively
chmod 600 <file>Permissions: owner read/write only (6=rw, 4=r, 1=x; digits are owner/group/other)
chown user:group <file>Change a file's owner
tar -xf file.tar.gz / unzip file.zipExtract archives

System & processes

whoami / idWho you are / your uid (0 = root)
ps auxList every running process with its owner
kill <pid>End a process (kill -9 forces it)
top / htopLive process monitor
sudo -lList what YOU may run as root โ€” check this on every box
systemctl status <svc>Is a service running? (start/stop/restart/enable)
journalctl -xeSystem log tail โ€” where services confess errors
df -h / du -sh <dir>Disk free space / how big is this folder
historyYour command history โ€” your built-in lab notebook

Networking

ip a (ifconfig)Your interfaces and IP addresses
ip routeYour gateway and routes
ping <ip>Is it alive? (ICMP echo)
ss -tulpnListening ports and the processes that own them
arp -aThe ARP table โ€” which MAC claims which IP
dig <domain> / nslookupDNS lookups
curl -I <url>Fetch just the HTTP headers of a page
ssh user@hostEncrypted remote shell
scp file user@host:/pathCopy a file over SSH

Free from the Hackbydoing Academy โ€” the game that teaches real cybersecurity, attack and defense, on simulated networks. Play free at hackbydoing.com ยท Print this page (Ctrl/Cmd+P) for a clean paper copy.