Advanced Terminal Lab
The earlier lessons in this path got you comfortable navigating and running basic commands. This lab pushes into the terminal skills that separate someone who can use Linux from someone who's genuinely fast and capable in it — text processing, scripting, and persistent sessions.
Tasks
- Process logs with grep, awk, and sed. Download or create a sample log file (any web server access log format works well) and practice:
These three tools, chained together, are the backbone of fast command-line log analysis — genuinely used daily in real security and DevOps work, not just a classroom exercise.grep "404" access.log # find all 404 errors awk '{print $1}' access.log | sort | uniq -c # count requests per IP sed 's/GET/REQUEST/g' access.log # find-and-replace across the file - Write a bash script that automates something real. A simple example: a script that pings a list of hosts and reports which are up.
Save it, run#!/bin/bash while read host; do if ping -c 1 -W 1 "$host" &> /dev/null; then echo "$host is UP" else echo "$host is DOWN" fi done < hosts.txtchmod +x script.sh, and execute it against a small text file of hostnames. - Practice pipes and redirection deliberately. Chain at least three commands together with
|, and practice all three redirection operators:>(overwrite a file),>>(append to a file), and2>(redirect only error output) — e.g.,nmap -p 1-1000 target 2> errors.log | tee results.txt. - Use tmux for persistent sessions. Start a
tmuxsession, split it into two panes (Ctrl+Bthen"), run a long-running command in one, detach (Ctrl+BthenD), and reattach later withtmux attach— this is exactly how real remote work sessions survive SSH disconnections, essential once you're regularly working against remote lab machines. - Master
xargsfor chaining find results into actions.findlocates files, butxargsis how you efficiently act on large result sets:find . -name "*.txt" | xargs grep -l "password"runsgrepagainst every matched file in one efficient batch, rather than requiring a slower loop. Compare its speed and simplicity against writing the equivalent as aforloop overfind's output. - Combine
watchwith a status command. Runwatch -n 2 'ss -tulnp'to see your machine's open ports refresh automatically every 2 seconds — genuinely useful for observing a service starting up, or watching a target's exposed ports change in real time during a lab exercise.
Every custom recon/automation tool referenced throughout this course (Path 20's portfolio lesson specifically recommends building one) starts as exactly this: a handful of standard Unix tools chained together in a small script. You don't need to learn a "real" programming language first — Path 04 covers Python next, but a huge amount of genuinely useful security tooling is just well-composed bash.
Write a bash script that combines at least 3 different tools/commands (e.g., whois, dig, curl, nmap) against a target you provide as an argument, and saves the combined output to a neatly organized file or set of files. This is a legitimate, portfolio-worthy first project — consider keeping and refining it as you progress through later paths.
Key takeaway
Fluency in grep/awk/sed, comfortable pipe-and-redirect chaining, and persistent sessions via tmux are what separate "I can technically use a terminal" from genuinely fast, professional command-line work — and every one of these skills compounds directly into the automation and scripting covered next in Path 04.
Next up → Linux Forensics Basics Lab