Linux Commands for Hackers
Security work runs on Linux, and the commands that matter most are not the flashy ones. They are file navigation, the permission model, process control, networking checks and text processing with grep, awk and sed. Master those and you can improvise in an engagement instead of copying from a cheat sheet.
Why these specifically
You will not follow a tutorial during a real engagement. You will be on a compromised host, improvising. These are the commands you reach for without thinking, grouped by what they do.
File system and navigation
ls -la list all, long format
cd /path change directory
find / -name x find files by name
locate x fast filename search
cat, less, head, tail read filesPermissions, the one that matters for hacking
Linux privilege escalation is almost entirely about the permission model. Know these cold:
chmod, chown change permissions and ownership
find / -perm -4000 2>/dev/null find SUID binaries
sudo -l what can this user run as root
id current user and groupsThat SUID find command is one of the first things you run after landing on a host. Detail in Linux privilege escalation.
Processes and services
ps aux all running processes
top / htop live process view
kill, pkill stop a process
systemctl manage services
crontab -l scheduled jobsNetworking
ip a interfaces and addresses
ss -tulpn listening ports and processes
curl, wget fetch over HTTP
nc netcat, the swiss army knifeText processing, the force multiplier
Parsing output fast separates slow testers from fast ones.
grep 'pattern' file search
cat file | grep x | wc -l count matches
awk '{print $1}' extract columns
sed 's/a/b/g' find and replace
cut -d: -f1 /etc/passwd extract fieldsFinding credentials and secrets
grep -r 'password' /var/www 2>/dev/null
find / -name '*.conf' 2>/dev/null
historyHow to actually learn these
Do not memorise a cheat sheet. Install Linux, use the terminal for everything, and learn each command when a task needs it. Fluency comes from living in it. Full approach in how to learn Linux for hacking.
Practise this
Attack and escalate on real Linux machines. Free targets on Hacklido.
Enroll in VAPT
Live instructor led training with hands on labs and a verifiable certificate. Or start free on Hacklido.
Enroll in VAPT