This article is Day 3 of a 100-day ethical hacking course that teaches 40 essential Linux terminal commands organized into seven practical categories: navigation, file operations, text viewing and searching, permissions, networking, processes, and package management. The article demonstrates that command-line proficiency is foundational to security work, as every major hacking tool (Nmap, Metasploit, Burp Suite, Nikto, Hydra) runs from or interacts with the terminal. The material emphasizes learning commands through contextual groupings rather than memorization, making the skills stick by connecting each command to real penetration testing scenarios.
- Terminal prompt anatomy reveals privilege levelThe article explains that a Linux prompt displays the username, hostname, current directory, and crucially, whether you have regular user ($) or root (#) privileges. This distinction is foundational: on Kali Linux, elevated commands require sudo prefix, but on a compromised target system, achieving a # prompt indicates successful privilege escalation—a critical goal in penetration testing.
- Piping chains commands for efficient data processingThe pipe operator (|) feeds one command's output as input to the next, enabling rapid processing of large outputs. The article demonstrates examples like `cat /etc/passwd | grep "bash"` to find bash users and `ps aux | grep "root"` to locate root processes. This technique is presented as how professionals quickly filter reconnaissance data during assessments.
- File permissions and SUID files enable privilege escalationThe article explains that Linux permissions control read, write, and execute access. A specific focus is SUID files (octal 4755), which execute with the owner's privileges. The command `find / -perm -4000` identifies SUID binaries, and the article identifies misconfigured SUID files as a common privilege escalation target on compromised systems—making permission enumeration a critical hacking skill.
- grep is the most important security commandThe article calls grep the most important text search command in security work. It covers case-insensitive searches (-i), recursive directory searches (-r), line numbering (-n), inverted matching to exclude patterns (-v), and regex patterns (-E) for matching multiple terms. These variations make grep essential for hunting passwords, usernames, and error patterns across config files and logs during penetration tests.
- Tab completion prevents typos and saves keystrokesThe article identifies Tab key auto-completion as a professional technique used hundreds of times daily. Typing partial commands or filenames and pressing Tab completes them automatically; double-tabbing shows all available options. This is framed not as optional polish but as a core productivity habit that eliminates typos and compounds into massive time savings over 100 days.
- Package management maintains hacking tool availabilityThe article presents APT commands as the gateway to installing security tools on Kali. The essential sequence is `sudo apt update` (refresh packages), `sudo apt full-upgrade -y` (upgrade all packages), and `sudo apt install [tool] -y` (install specific tools). The article recommends running this full sequence after fresh Kali installation and weekly thereafter to keep tools current.
- Linux lacks file recovery, making deletion irreversibleThe article emphasizes that Linux has no Recycle Bin: `rm` permanently deletes files immediately. This risk is highlighted through the warning against `rm -rf /` which deletes the entire system. The article recommends moving uncertain files to `/tmp/` instead of deleting them, since `/tmp/` clears on reboot, providing a safety window for recovery.
- Networking commands enable reconnaissance phaseThe article groups commands for network visibility: `ifconfig` or `ip a` show your interfaces and IP; `ping` tests reachability; `dig` and `nslookup` perform DNS lookups; `netstat` or `ss` reveal listening ports and established connections; `curl -I` fetches HTTP headers to identify server software; `traceroute` maps the path to targets. These form the reconnaissance toolkit for the initial assessment phase.
Bottom line: Linux terminal fluency through these 40 commands across seven practical categories is non-negotiable foundational knowledge for ethical hacking—every security tool runs from or interacts with the command line, and comfort with navigation, text searching, permissions, and networking commands enables efficient reconnaissance and exploitation during real penetration tests. The article's emphasis on contextual learning and daily repetition (with keyboard shortcuts like Tab completion and reverse his
Day 100 — Professional Pentester
I’ve structured today’s lesson around seven categories of commands. Instead of throwing 40 commands at you as a random list to memorise, I want you to understand why each group exists and when you’ll reach for it during a real assessment. That context is what makes commands stick.
Understanding the Terminal Before You Type Anything
Open a terminal in Kali Linux now. What you see is called a prompt. Before typing a single command, I need you to understand what you’re looking at — because this context makes everything else click into place.
That $ vs # distinction matters enormously. When you see # in the prompt or in a tutorial, it means root privileges. On Kali, you’ll often use sudo before commands that need elevated access. On Day 1 of discovering you have root on a target machine during a pentest, seeing that # prompt will feel very different. Remember it.
CATEGORY 1
Navigation — Moving Around the Filesystem
Before you can attack or defend anything, you need to know where you are in the filesystem and how to move around. These are the commands you will type hundreds of times every single day.
cd Des then press Tab — it auto-completes to cd Desktop/. This saves you thousands of keystrokes and eliminates typos. Use it constantly.
CATEGORY 2
File Operations — Creating, Moving, Copying, Deleting
During a penetration test you’ll constantly create notes, move payloads, copy evidence files, and clean up traces. These commands are your file management toolkit.
rm permanently deletes files immediately — there is no Recycle Bin. Always double-check before running rm -r. When in doubt, move the file to /tmp/ instead of deleting it — /tmp/ clears on reboot, giving you a safety window.
CATEGORY 3
Viewing & Searching Text — The Hacker’s Most Used Skill
Reading config files, searching scan output for passwords, analysing log files — security work involves a lot of reading text. These are the commands that make that fast and powerful.
| is one of Linux’s most powerful ideas: It takes the output of one command and feeds it as input to the next. cat file.txt | grep "password" | head -5 reads a file, finds lines with “password”, and shows only the first 5 results. Chaining commands with pipes is how professionals process large outputs quickly.
CATEGORY 4
Permissions & Ownership — The Key to Privilege Escalation
Linux permissions control who can read, write, and execute files. Misconfigurations here are one of the most common paths to privilege escalation on a target system. You need to understand this both for attacking and for hardening.
| Octal | Symbolic | Meaning | Common Use |
|---|---|---|---|
| 777 | rwxrwxrwx | Everyone can do everything | ⚠️ Dangerous — often a misconfiguration |
| 755 | rwxr-xr-x | Owner: all | Others: read+exec | Scripts, executables |
| 644 | rw-r–r– | Owner: rw | Others: read only | Config files, documents |
| 600 | rw——- | Owner: rw only | Others: nothing | SSH private keys |
| 4755 | rwsr-xr-x | SUID set — runs as owner’s privileges | 🎯 Privesc target when misconfigured |
CATEGORY 5
Networking — Your Reconnaissance Toolkit
Ethical hacking is fundamentally about networks. These commands let you see the network around you, test connectivity, and begin the reconnaissance phase of any assessment.
CATEGORY 6
Processes & System — Seeing What’s Running
CATEGORY 7
Package Management — Installing and Updating Tools
⚡ Terminal Pro Tips — Work 3× Faster
These aren’t extra commands — they’re keyboard shortcuts and tricks that professional pentesters use hundreds of times a day. Learning them now will compound over 100 days into a massive productivity difference.
clear. Keeps your workspace clean when it gets cluttered.--help flag. When you forget a flag, type nmap --help before searching Google — it’s faster.man nmap, man grep, man chmod. Press q to quit. Underused by beginners.nmap target > scan.txt. Essential for saving evidence during a pentest.📋 Quick Reference — All 40 Commands at a Glance
Bookmark this section. This is the cheat sheet you’ll come back to during the first 30 days of this course. Every command covered today in one scannable table.
| Command | What It Does | Category |
|---|---|---|
| pwd | Show current directory | Navigate |
| ls -la | List all files incl. hidden | Navigate |
| cd <path> | Change directory | Navigate |
| file <name> | Identify file type by content | Navigate |
| touch <file> | Create empty file | Files |
| mkdir -p <path> | Create directories recursively | Files |
| cp -r <src> <dst> | Copy file or folder | Files |
| mv <src> <dst> | Move or rename | Files |
| rm -r <path> | Delete file or folder (permanent) | Files |
| find / -name <x> | Find files by name system-wide | Files |
| echo “x” >> file | Append text to a file | Files |
| cat <file> | Print file contents | Text |
| less <file> | Scroll through large files | Text |
| head / tail -n | First/last N lines of file | Text |
| grep -ri <pat> | Search files for pattern | Text |
| cmd | grep <x> | Pipe output to search | Text |
| cut -d: -f1 | Extract field from output | Text |
| wc -l | Count lines in file | Text |
| chmod 755 <file> | Change file permissions | Perms |
| chown user:grp | Change file ownership | Perms |
| sudo <command> | Run command as root | Perms |
| sudo -l | List allowed sudo commands | Perms |
| id / whoami | Show current user and groups | Perms |
| ifconfig / ip a | Show network interfaces + IPs | Network |
| ping -c 4 <host> | Test host reachability | Network |
| dig / nslookup | DNS lookup | Network |
| netstat -tuln | Show listening ports | Network |
| curl -I <url> | Fetch HTTP headers | Network |
| wget <url> | Download file from URL | Network |
| traceroute | Trace route to target | Network |
| ps aux | Show all running processes | Process |
| kill -9 <pid> | Force-kill a process | Process |
| uname -a | Kernel and OS version | System |
| df -h / free -h | Disk and RAM usage | System |
| history | All past commands | System |
| apt update | Refresh package list | Packages |
| apt install <x> -y | Install a package | Packages |
| apt search <x> | Search for available tools | Packages |
| dpkg -l | grep <x> | Check if tool is installed | Packages |
| man <command> | Full manual for any command | Help |
🎯 Day 3 Practical Task
cd /), explore with ls, then find your way back to home. Use pwd to confirm where you are at each step.cut -d: -f1 /etc/passwdfc -ln 1 > ~/Day3/day3_commands.txt
cat ~/Day3/day3_commands.txt
How many lines are in the rockyou.txt password wordlist? Find it, count it, and note it down. First hint: it’s in /usr/share/wordlists/. You may need to unzip it first. Figure it out — this is your first real problem-solving challenge.
You live here now.
40 commands. Seven categories. One goal: fluency. Come back to this page whenever you forget a command — it’s here. Day 4 covers the Linux file system in depth — understanding /etc, /var, /tmp, and why every directory matters to a hacker.
Frequently Asked Questions — Day 3 Linux Commands for Ethical Hacking
I still remember the day the terminal “clicked” for me — when it stopped being intimidating and started feeling like a superpower. That usually happens around Day 5–10 for most students. You’re closer than you think. Keep going.

