0% Complete
0/0 Steps
  1. About

    About Cyber School
  2. About BDO
  3. The CSRP program Syllabus
  4. Module 1
    The Cyber World and CIA Triad
    6 Topics
  5. The OSI Model and Network Layers
    6 Topics
  6. IP Addressing, Subnetting and Routing
    6 Topics
  7. DNS and DHCP
    6 Topics
  8. Windows Server Administration
    6 Topics
  9. Active Directory and Identity Management
    6 Topics
  10. Linux CLI Fundamentals
    6 Topics
  11. Linux Permissions and Hardening
    6 Topics
  12. Module 2 - Defense Technologies and Cyber Tools
    Firewall Architecture and Rule Design
    5 Topics
  13. NAT and Secure Traffic Mapping
    6 Topics
  14. Enterprise VPN Solutions
    6 Topics
  15. IDS and IPS
    5 Topics
  16. Identity and Access Management
    5 Topics
  17. Multi-Factor Authentication
    6 Topics
  18. Data Loss Prevention
    6 Topics
  19. Endpoint Security and EDR
    6 Topics
  20. Mail Security
    6 Topics
  21. Web Proxy and URL Filtering
    6 Topics
  22. Regulation and Compliance
    6 Topics
  23. Cloud Security
    6 Topics
    |
    1 Quiz
  24. Module 3 - Ai in security
    AI in Security
    5 Topics
  25. ML Anomaly Detection
    5 Topics
  26. AI Threats
    5 Topics
  27. LLM Defense
    6 Topics
  28. Module 4 - Offensive Cyber & Vulnerability Scanning
    Cyber Kill Chain and Attacker Mindset
    6 Topics
  29. OSINT and Public Intelligence Gathering
    6 Topics
  30. Network and Port Scanning with Nmap
    6 Topics
  31. Vulnerability Scanning
    6 Topics
  32. Exploitation Fundamentals
    6 Topics
  33. Web Application Security
    5 Topics
  34. Social Engineering
    5 Topics
  35. Password and Hash Cracking
    5 Topics
  36. Module 5 - SOC and Advance Cyber Analyst
    SOC Structure and Operations
    6 Topics
  37. SIEM Fundamentals with Splunk
    6 Topics
  38. Alerting and Dashboards
    6 Topics
  39. Incident Response
    5 Topics
  40. Basic Digital Forensics
  41. Capstone A - The Attack: Breaching Meridian
  42. Capstone B - The Defense: Defending Meridian
  43. ISC2 CC Mock Exam and CSRP Graduation
    2 Quizzes
Lesson 10, Topic 1
In Progress

Linux CLI Fundamentals Textbook

Cyber School 23/11/2026
Lesson Progress
0% Complete

CSRP  —  Cyber Security Responder & Practitioner

Lesson 7: Linux CLI Fundamentals

Textbook

Cyber School  ·  BDO Ziv Haft

CSRP TEXTBOOK (v2.1)

L7 — Linux CLI Fundamentals

v2.1 — adds Chapter 4 (Processes + Network); restructures Chapter 5 (composition patterns); Challenge is multi-step “Linux CLI Master.”

Markers: ▶ TIP · ✎ TRY · ◆ KEY TERM · ✶ REAL-WORLD · ⚑ WATCH OUT.

Objectives

By the end you can: connect via SSH and navigate the Linux filesystem; read/write files via CLI; compose commands with pipes, grep, find; inspect processes and listening network ports; complete a multi-step CLI investigation.


Chapter 1 — Why the CLI

(Identical to v2 textbook §1. Six reasons CLI > GUI; anatomy of a command; the case for the field.)


Chapter 2 — Filesystem Navigation

(Identical to v2 textbook §2. FHS hierarchy; pwd / ls / cd / paths; case-sensitivity warning.)


Chapter 3 — Read/Write + Pipes + Search

(Combines v2 §3, §4, §5 since pipes + grep + find are tightly linked.)

3.1 Reading files

cat / less / head / tail (-f).

3.2 Writing files

touch / nano / echo > / echo >> / cp / mv / rm (no undo) / mkdir.

3.3 Pipes and redirection

| chains commands. > >> < 2>/dev/null. The Unix philosophy: small tools, text streams, complex behavior from simple parts.

3.4 grep

Flags: -r -i -v -n -l -E.

3.5 find

Conditions: -name -size -mtime -user -perm -type -exec.

✎ TRY IT In Lab 7.2, build the pipeline grep “Failed password” /var/log/auth.log | awk ‘{print $1, $2, $3}’ > ~/failed_logins.txt. That single line replaces an hour of GUI clicks.

Ch.3 in one line: pipes + redirection + grep + find are the CLI composability layer; mastery here makes every later module faster.


Chapter 4 — Processes and Network (NEW IN v2.1)

The other half of “first day on a Linux box.”

4.1 Inspecting processes

◆ KEY TERM — ps Reports running processes. ps alone shows only the current shell’s processes. ps aux shows every process on the system, with USER, PID, %CPU, %MEM, VSZ, RSS, TTY, STAT, START, TIME, COMMAND columns.

◆ KEY TERM — top Live, refreshing process view. Sorted by CPU usage by default. Press q to exit, M to sort by memory, P to sort by CPU, k to kill (followed by PID prompt).

◆ KEY TERM — htop A friendlier top with color, mouse support, and tree mode. Often installed by default on modern distros.

Typical patterns: – ps aux | grep ssh — show every sshd process. – ps aux | grep python — show every python process. – ps -p <PID> — show details for one PID. – ps aux –sort=-%cpu | head — top 10 by CPU.

4.2 Inspecting the network

◆ KEY TERM — ss “Socket statistics.” Modern replacement for netstat. Common flags: -t TCP, -u UDP, -l listening only, -n numeric (no DNS resolution), -p show process (requires root for full info), -a all (including non-listening).

Typical patterns: – ss -tuln — listening TCP and UDP sockets, numeric. – ss -tulnp (as root) — same plus PID/process name. – ss -tan — all TCP, numeric, established + listening.

◆ KEY TERM — ip Modern network configuration tool. Replaces ifconfig and route. ip a shows addresses; ip route shows the routing table; ip link shows interfaces.

◆ KEY TERM — ping L3 reachability test. Sends ICMP echo requests. ping -c 4 <target> sends exactly 4 and exits.

◆ KEY TERM — curl A versatile HTTP/HTTPS/FTP client. curl http://host gets the page; curl -I http://host gets just headers; curl -v shows verbose connection details.

4.3 Starting a quick test service

A SOC analyst’s common trick to verify network paths:

python3 -m http.server 8080

Starts a one-liner HTTP server in the current directory on port 8080. Useful for “can host A reach host B on TCP/8080?” tests.

4.4 Stopping a process

  • kill <PID> — SIGTERM (15). Graceful shutdown; process can clean up.
  • kill -9 <PID> — SIGKILL (9). Immediate, ungraceful. Use only if SIGTERM doesn’t work.
  • pkill -f <pattern> — kill by command-line pattern.
  • killall <name> — kill by process name.

Verify the kill worked: ps aux | grep <name> or ss -tuln | grep <port>.

⚑ WATCH OUT kill -9 doesn’t let the process clean up — open files may stay locked, database transactions may not commit. Try SIGTERM first.

✶ REAL-WORLD During incident response, the first commands you’ll run on a suspected-compromised Linux box are: ps aux (what’s running?), ss -tulnp (what’s listening?), ip a and ip route (any unexpected interfaces or routes?), lsof -i (open network connections, preview), crontab -l and cat /etc/crontab (any scheduled tasks?). Today’s Lab 7.3 drills the first three.

Ch.4 in one line: ps/top to see processes; ss/ip/ping/curl to inspect network; kill to stop — the foundation of “what’s actually happening on this box right now?”


Chapter 5 — Putting It All Together

5.1 Four composition patterns

Pattern 1 — Needle in haystack

find / -type f 2>/dev/null | xargs grep -l “<pattern>” 2>/dev/null

Find every file under /; from those, print filenames containing the pattern; suppress errors.

Pattern 2 — Listening + which process

sudo ss -tulnp

Then ps -p <PID> to see the full command line.

Pattern 3 — Log analysis

tail -n 200 /var/log/syslog | grep “ERROR” | awk ‘{print $5}’ | sort | uniq -c | sort -rn | head

Last 200 syslog lines → filter to ERROR → extract a field → count distinct values → sort descending → top 10. The “what are the top error patterns” SOC one-liner.

Pattern 4 — Follow the clues

A multi-step investigation that walks from one file to another, decoding payloads along the way. Today’s Challenge uses this pattern exactly:

cat clue1.txt
find . -name “clue2.txt”
cat folders/beta/clue2.txt
grep “FLAGPATH” logs/challenge.log
cat hidden/encoded.txt | base64 -d

✎ TRY IT In the Challenge, work the chain in order. Don’t skip steps; each clue’s payload tells you what to do next.

5.2 The Unix philosophy, restated

You don’t memorize 1,000 tools. You learn ~30 good ones and how to compose them. Today’s lesson covers the foundational ~30. The next 33 lessons build on this base.

Ch.5 in one line: composition is the superpower; learn the basic tools and the patterns, and you can investigate anything on a Linux host.


Chapter 6 — Hands-On

  • 7-Quick — whoami. 2 min.
  • Lab 7.1 — Linux Filesystem Navigation. 12 min.
  • Lab 7.2 — Search, Grep, Pipes, and Redirection. 15 min.
  • Lab 7.3 — Processes and Network Checks. 15 min.
  • Challenge — Linux CLI Master. 25-35 min.

Challenge — “Linux CLI Master”

Start at ~/csrp-labs/lesson7/ctf/clue1.txt. Follow the chain. Decode the final Base64 payload. Submit the ULC{…} flag.

▶ TIP Each clue tells you exactly which command to use next. Don’t skip ahead.


Further reading

  • The Linux Documentation Project: https://tldp.org/
  • man bash, man find, man grep, man awk, man sed, man ps, man top, man ss, man ip, man kill, man curl
  • Brian Kernighan & Rob Pike — The Unix Programming Environment
  • The Filesystem Hierarchy Standard: https://refspecs.linuxfoundation.org/fhs.shtml
  • MITRE ATT&CK T1564.001 (Hidden Files), T1140 (Deobfuscate/Decode Files or Information), T1057 (Process Discovery), T1049 (System Network Connections Discovery)

Bibliography

  • Kernighan, B. W. & Pike, R. The Unix Programming Environment. Prentice Hall.
  • Stevens, W. R. & Rago, S. A. Advanced Programming in the Unix Environment (3rd ed.). Addison-Wesley.
  • Linux Foundation. Filesystem Hierarchy Standard.