Hackbydoing Academy cheat sheet ยท linux ยท terminal ยท files ยท permissions
| ls -la | List everything, including hidden (dot) files |
| cd <dir> / cd .. / cd ~ | Move into a folder / up one / home |
| pwd | Print 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/null | Find 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.zip | Extract archives |
| whoami / id | Who you are / your uid (0 = root) |
| ps aux | List every running process with its owner |
| kill <pid> | End a process (kill -9 forces it) |
| top / htop | Live process monitor |
| sudo -l | List what YOU may run as root โ check this on every box |
| systemctl status <svc> | Is a service running? (start/stop/restart/enable) |
| journalctl -xe | System log tail โ where services confess errors |
| df -h / du -sh <dir> | Disk free space / how big is this folder |
| history | Your command history โ your built-in lab notebook |
| ip a (ifconfig) | Your interfaces and IP addresses |
| ip route | Your gateway and routes |
| ping <ip> | Is it alive? (ICMP echo) |
| ss -tulpn | Listening ports and the processes that own them |
| arp -a | The ARP table โ which MAC claims which IP |
| dig <domain> / nslookup | DNS lookups |
| curl -I <url> | Fetch just the HTTP headers of a page |
| ssh user@host | Encrypted remote shell |
| scp file user@host:/path | Copy 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.