Terminal Basics & Navigation
The Linux command line is the primary interface for every major security tool, and fluency with the terminal is non-negotiable for any aspiring hacker. You will learn to navigate the filesystem, manipulate files and directories, and use essential commands that form the foundation of all Linux work. By the end of this lesson, the terminal will feel like a natural extension of your hands.
Learning Objectives — Deep Dive
Each objective below is broken down into plain English so you know exactly what you are learning, why it matters, and what you will be able to do when you are done. Mark each one complete as you work through the lesson.
Open a terminal
In Kali Linux, right-click the desktop and select 'Open Terminal Here', or click the terminal icon in the taskbar. You will see a prompt in the format 'kali@kali:~$' — the tilde (~) represents your home directory (/home/kali). If you are working on a remote server via SSH, the terminal is your only interface, so becoming comfortable with it now is essential. Try pressing Ctrl+Alt+T as a keyboard shortcut to open a new terminal window quickly.
Navigate the file system
Run 'pwd' to confirm your starting location, then practice navigating to the key directories every hacker needs to know: 'cd /etc' (system configuration files), 'cd /var/log' (log files that record system activity), 'cd /home' (user home directories), and 'cd /tmp' (world-writable temporary storage often used in exploits). After each 'cd' command, run 'ls -la' to see all files including hidden ones (those starting with a dot). Use 'cd ~' to return to your home directory and 'cd -' to jump back to the previous directory.
cd /etc && ls -laRead important files
Run 'cat /etc/passwd' to view all user accounts on the system — each line contains the username, UID, GID, home directory, and default shell. The /etc/shadow file stores password hashes and requires root to read; run 'sudo cat /etc/shadow' to view it. In a real privilege escalation scenario, reading /etc/shadow gives you hashes to crack offline. Notice that service accounts like www-data and nobody have /usr/sbin/nologin as their shell, which prevents interactive login.
cat /etc/passwd && sudo cat /etc/shadowSearch for files
Run 'find / -perm -4000 -type f 2>/dev/null' to find all SUID (Set User ID) binaries on the system. SUID binaries run with the permissions of their owner rather than the user who executes them — if a SUID binary is owned by root, it runs as root regardless of who launches it. The '2>/dev/null' redirects error messages (permission denied) to /dev/null so they do not clutter your output. Any unusual SUID binary that is not part of the standard Linux installation is a potential privilege escalation vector.
find / -perm -4000 -type f 2>/dev/nullUse pipes
Run 'cat /etc/passwd | grep -v nologin | cut -d: -f1' to extract only the usernames of accounts that have a real login shell. The pipe (|) sends the output of one command as input to the next — this is one of the most powerful concepts in Linux. The 'grep -v nologin' filters out service accounts, and 'cut -d: -f1' extracts only the first field (username) using colon as the delimiter. Practice building longer pipelines: 'ps aux | grep apache | grep -v grep | awk "{print $2}"' extracts the PID of the apache process.
cat /etc/passwd | grep -v nologin | cut -d: -f1