CSRP — Cyber Security Responder & Practitioner
Lesson 7: Linux CLI Fundamentals
Terminology Bank
Cyber School · BDO Ziv Haft
TERMINOLOGY BANK (v2.1) — cyberPedia feed
Lesson 7 — Linux CLI Fundamentals
A structured glossary of every technical term introduced in Lesson 7. 26 entries — 22 carried over from v2 + 4 new (ps, ss, top, kill), plus 1 updated badge entry. Each entry feeds the course-wide cyberPedia. Cross-links between entries are written as [[term-slug]] — the cyberPedia renderer resolves them to anchors.
Header
| Field | Value |
| Lesson | 7 — Linux CLI Fundamentals (v2.1) |
| Total terms | 26 |
| First-introduced terms | 26 (all introduced in Lesson 7) |
Foundational concepts
CLI (Command-Line Interface)
- Hebrew: ממשק שורת פקודה
- Acronym: CLI = Command-Line Interface
- Category: Operating-system interface
- Short: A text-based way to control a computer by typing commands rather than clicking.
- Long: The CLI is the original computer interface and still the dominant way professionals administer servers, run security tooling, and automate work. A user types a command, the shell parses and runs it, and the output is printed back as text. Every keystroke is scriptable, repeatable, and inexpensive to log — qualities that GUIs cannot match. On Linux, every modern role (SysAdmin, DevOps, SRE, SecOps, DFIR) expects fluency at the CLI.
- Why it matters to a defender: the CLI is faster, scriptable, remote-friendly, and the only available interface on most production servers. The next 33 lessons all assume CLI literacy.
- First introduced in: Lesson 7
- Related: [shell], [bash], [[terminal-tty]]
- Reference: CSRP Textbook L7 §1
Shell
- Hebrew: מעטפת
- Acronym: —
- Category: Operating-system component
- Short: The program that reads what the user types, runs commands on their behalf, and shows the output.
- Long: A shell is a thin layer between the user and the kernel. It parses each line you type, expands variables and wildcards, sets up redirections and pipes, and invokes the right programs. Common Linux shells: bash (default on most distros), zsh (default on macOS), dash (used for /bin/sh on Debian/Ubuntu), and fish. Shells are themselves scriptable languages; CSRP introduces shell scripting in later lessons.
- Why it matters to a defender: the shell is your operating environment for the rest of your career. Knowing what it does — and especially what it expands before running — prevents the worst class of CLI accidents.
- First introduced in: Lesson 7
- Related: [bash], [[cli]], [[wildcard-glob]]
- Reference: man bash; CSRP Textbook L7 §1.2
Bash
- Hebrew: Bash / מעטפת Bash
- Acronym: Bash = Bourne Again Shell
- Category: Shell
- Short: The default shell on most Linux distributions; a successor to the original Bourne shell (sh).
- Long: Bash adds features over the classic Bourne shell: command-line editing, history (saved to .bash_history), tab completion, aliases, brace expansion, arrays. It is both an interactive shell and a scripting language; nearly all shell scripts in the wild are written for bash. Knowing the bash-specific syntax (vs POSIX sh) matters when writing portable scripts.
- Why it matters to a defender: every Linux server you SSH into will probably drop you into bash; your audit trail will live in .bash_history.
- First introduced in: Lesson 7
- Related: [shell], [[bash-history]]
- Reference: man bash; https://www.gnu.org/software/bash/
SSH (Secure Shell)
- Hebrew: SSH / מעטפת מאובטחת
- Acronym: SSH = Secure Shell
- Category: Remote-access protocol
- Short: An encrypted protocol for logging into a remote machine and running shell commands over the network.
- Long: SSH replaces older clear-text protocols (telnet, rsh, rlogin) with strong encryption and authentication. Authentication is by password or — better — by public/private key pair. Default port: TCP/22. The client is ssh user@host; the server daemon is sshd. SSH also supports port forwarding (tunnels) and file transfer (scp, sftp). SSH is the primary way you reach Linux servers in this course.
- Why it matters to a defender: SSH is both the lifeline (the way you reach production) and a primary attacker target (brute-force, stolen keys). Most “Failed password” events in /var/log/auth.log come from SSH.
- First introduced in: Lesson 7
- Related: [bash], [[cli]]
- Reference: RFC 4251-4254 — The Secure Shell Protocol
Terminal / TTY
- Hebrew: מסוף / TTY
- Acronym: TTY = Teletypewriter (historical)
- Category: Operating-system interface
- Short: The text input/output device — historically a physical teletype, today a terminal emulator window on your desktop or an SSH session.
- Long: From the OS’s point of view, every shell session is attached to a TTY (or pseudo-TTY, “pts”) — a character device the shell reads from and writes to. The command tty prints the path (e.g., /dev/pts/0). The STAT column in ps shows which processes have a controlling TTY and which run detached.
- Why it matters to a defender: when investigating who did what, the TTY tells you whether a process is interactive (a person logged in) or background (a daemon or scheduled task). Differences here are diagnostic.
- First introduced in: Lesson 7
- Related: [shell], [[ps]]
- Reference: man tty
Filesystem
Filesystem Hierarchy Standard (FHS)
- Hebrew: תקן היררכיית מערכת הקבצים
- Acronym: FHS
- Category: Filesystem layout
- Short: The agreed-upon layout of directories under / on Linux systems.
- Long: The FHS specifies where conventional files live: /etc for configuration, /var/log for log files, /usr/bin and /bin for command binaries, /home/<user> for user data, /tmp for temporary files, /opt for optional/third-party software, /root for the root user’s home (NOT to be confused with /). Defenders rely on the FHS to find things quickly without exhaustive searching.
- Why it matters to a defender: if you know the FHS you can guess where a config file or a log file lives without searching, and you can spot suspicious files that do not belong in their location.
- First introduced in: Lesson 7
- Related: [[path-absolute-relative]], [[working-directory]]
- Reference: https://refspecs.linuxfoundation.org/fhs.shtml
Path (Absolute / Relative)
- Hebrew: נתיב (מוחלט / יחסי)
- Acronym: —
- Category: Filesystem
- Short: The textual address of a file or directory. Absolute paths start with /; relative paths are interpreted from the current directory.
- Long: An absolute path is unambiguous from anywhere: /var/log/auth.log always points to the same file. A relative path depends on the working directory: logs/auth.log resolves to <pwd>/logs/auth.log. Special tokens: . is the current directory, .. is the parent, and ~ is the current user’s home. Most CLI errors of the form “No such file or directory” are path mistakes.
- Why it matters to a defender: scripts and incident-response commands must use the right kind of path for the job — absolute for cron jobs and systemd units (which start without a meaningful working directory), relative for short interactive work.
- First introduced in: Lesson 7
- Related: [[working-directory]], [[fhs]]
- Reference: CSRP Textbook L7 §2.3
Working Directory
- Hebrew: ספריית עבודה
- Acronym: —
- Category: Filesystem
- Short: The directory the shell is “in” right now, against which relative paths are interpreted. Shown by pwd.
- Long: Every process — not just the shell — has its own current working directory inherited at start. cd changes the shell’s working directory; the kernel call behind it is chdir(2). Many obscure script failures come from running with an unexpected working directory; that’s why hardened scripts begin with cd “$(dirname “$0″)” or use absolute paths throughout.
- Why it matters to a defender: when reproducing a colleague’s investigation, the working directory is part of the context. If you cannot reproduce, ask “where were you when you ran it?”
- First introduced in: Lesson 7
- Related: [[path-absolute-relative]], [[pwd]]
- Reference: man pwd; POSIX
Hidden File / Dotfile
- Hebrew: קובץ נסתר / Dotfile
- Acronym: —
- Category: Filesystem convention
- Short: Any file or directory whose name begins with a dot (e.g., .bash_history, .ssh). The shell convention is to hide them from default ls output.
- Long: Dotfiles are not “secret” in any cryptographic sense — they are normal files that ls simply omits unless you pass -a. Standard examples: .bashrc, .profile, .bash_history, .ssh/, .config/. Because they are hidden by default, attackers sometimes place payloads in dotfiles to evade casual inspection (MITRE ATT&CK T1564.001). A simple ls -la exposes them.
- Why it matters to a defender: when triaging a Linux host, always run ls -la — never plain ls — in interesting directories. Unfamiliar dotfiles are a known IOC.
- First introduced in: Lesson 7
- Related: [[bash-history]], [[ls]]
- Reference: MITRE ATT&CK T1564.001 — Hidden Files and Directories
.bash_history (Audit Trail)
- Hebrew: היסטוריית פקודות Bash
- Acronym: —
- Category: Audit artifact
- Short: A per-user dotfile in the home directory that records the commands typed in interactive bash sessions.
- Long: When bash exits, it appends the session’s history to ~/.bash_history (size limited by HISTSIZE and HISTFILESIZE). The file is the simplest “what did this account do?” forensic artifact on a Linux host. Sophisticated attackers will truncate it, redirect it to /dev/null, or unset HISTFILE — each of which is itself a detectable signal (a missing or unexpectedly-short .bash_history for a user who actually logged in).
- Why it matters to a defender: first-stop forensic artifact during a Linux compromise investigation. Centralized shell logging (auditd, sudosh, bash audit) is the hardened alternative.
- First introduced in: Lesson 7
- Related: [bash], [[hidden-file-dotfile]]
- Reference: man bash (HISTORY section)
Streams, pipes, redirection
stdin / stdout / stderr
- Hebrew: קלט תקני / פלט תקני / שגיאה תקנית
- Acronym: stdin = standard input; stdout = standard output; stderr = standard error
- Category: I/O model
- Short: The three standard streams every Unix process gets at startup. File descriptor 0 = stdin (input), 1 = stdout (normal output), 2 = stderr (error output).
- Long: A program reads from stdin (default: keyboard), writes results to stdout (default: terminal), and writes diagnostics/errors to stderr (also default: terminal, but on a separate stream). Keeping the two output streams separate lets you pipe one and capture the other — for example, find / 2>/dev/null silences the error stream without silencing the results.
- Why it matters to a defender: mixing or losing stderr is a classic cause of “I lost the error message” in scripts. Always know which descriptor is which.
- First introduced in: Lesson 7
- Related: [[pipe]], [[redirection]]
- Reference: POSIX; CSRP Textbook L7 §3.3
Pipe (|)
- Hebrew: צינור
- Acronym: —
- Category: Shell composition
- Short: The shell operator that connects one command’s stdout to the next command’s stdin.
- Long: Pipes are the central tool of shell composition: cmd1 | cmd2 | cmd3 runs all three concurrently, with each command’s output streaming directly into the next. They enable the Unix philosophy — small focused tools cooperating without files in between. They do NOT pipe stderr by default; use |& (bash) or 2>&1 | to include error output.
- Why it matters to a defender: every nontrivial CLI investigation uses a pipeline of grep | awk | sort | uniq -c | sort -rn | head. Mastering pipes is mastering the shell.
- First introduced in: Lesson 7
- Related: [[stdin-stdout-stderr]], [[unix-philosophy]], [grep]
- Reference: CSRP Textbook L7 §3.3
Redirection (>, >>, <, 2>)
- Hebrew: הפניה (של פלט/קלט)
- Acronym: —
- Category: Shell composition
- Short: The shell operators that send a stream to or from a file instead of the terminal.
- Long: > writes stdout to a file (overwriting). >> appends. < reads stdin from a file. 2> redirects stderr. &> (bash) redirects both stdout and stderr. 2>&1 merges stderr into stdout. The most common safety mistake is using > when >> was intended, silently overwriting a log.
- Why it matters to a defender: every saved investigation artifact (“write this to a ticket”) uses redirection. Suppressing noise with 2>/dev/null is a daily move.
- First introduced in: Lesson 7
- Related: [[stdin-stdout-stderr]], [[pipe]]
- Reference: man bash (REDIRECTION section)
Unix Philosophy
- Hebrew: פילוסופיית יוניקס
- Acronym: —
- Category: Design principle
- Short: “Write programs that do one thing well. Write programs to work together. Write programs that handle text streams, because that is a universal interface.” (Doug McIlroy, Ken Thompson)
- Long: The Unix philosophy explains why a few dozen small tools (grep, find, awk, sed, sort, uniq, wc, cut, tr, xargs) can be composed into more capable pipelines than any single monolithic application could ship. It is the doctrinal opposite of the GUI “one big program does everything” model. CSRP teaches the philosophy itself, not just the tools, because the tools will change but the philosophy will not.
- Why it matters to a defender: the mental model behind every CLI investigation. Once internalised, you stop searching for “the right tool” and start composing the ones you already know.
- First introduced in: Lesson 7
- Related: [[pipe]], [grep], [awk], [sed]
- Reference: Kernighan & Pike — The Unix Programming Environment
Text-processing tools
grep
- Hebrew: grep (חיפוש תבניות בקבצים)
- Acronym: grep = global / regular expression / print (historical: g/re/p)
- Category: Text-search tool
- Short: Searches inside files for lines matching a pattern (literal or regular expression).
- Long: Flags: -r recursive; -i case-insensitive; -v invert (lines NOT matching); -n show line numbers; -l print only filenames containing a match; -c count matches; -E extended regex (grep -E “(a|b)”); -w whole word; -A N / -B N / -C N show N lines after / before / context. The defender’s daily question “is this string anywhere in these files?” is a grep question.
- Why it matters to a defender: the single most-used text-search tool in cyber. Log triage, config audits, IOC searches — all grep.
- First introduced in: Lesson 7
- Related: [[pipe]], [find], [awk], [sed]
- Reference: man grep; POSIX
find
- Hebrew: find (חיפוש קבצים לפי מאפיינים)
- Acronym: —
- Category: File-search tool
- Short: Searches a directory tree for files matching attributes — name, size, modification time, owner, permissions, type.
- Long: Conditions: -name “<glob>”, -iname case-insensitive, -size +100M, -mtime -1 (modified in last 24 h), -user <name>, -group <name>, -perm -4000 (SUID bit), -type f|d|l. Actions: -print (default), -delete, -exec <cmd> {} \;, or pipe into xargs. Forensic uses: find files modified during the suspected attack window, find SUID binaries in unexpected places, find files owned by unexpected users.
- Why it matters to a defender: the workhorse for “show me every file matching ” — a constant DFIR question.
- First introduced in: Lesson 7
- Related: [grep], [xargs], [[wildcard-glob]]
- Reference: man find
awk
- Hebrew: awk
- Acronym: awk = Aho, Weinberger, Kernighan (its authors)
- Category: Text-processing language
- Short: A small programming language tuned for line-by-line column extraction and computation from text streams.
- Long: awk splits each input line into fields (default: whitespace) and lets you act on them by column number: awk ‘{print $1}’ prints the first column. Full programs add patterns and actions: awk ‘/Failed password/ {print $11}’ auth.log prints column 11 of every matching line. Builtin variables: NR (record number), NF (number of fields), $0 (whole line). Used heavily inside pipelines.
- Why it matters to a defender: the most efficient way to extract specific columns from log lines, between grep (filter) and sort | uniq -c (count).
- First introduced in: Lesson 7
- Related: [[pipe]], [grep], [[unix-philosophy]]
- Reference: man awk; GAWK manual
sed
- Hebrew: sed
- Acronym: sed = stream editor
- Category: Text-transformation tool
- Short: A non-interactive stream editor: reads input line by line, applies edit commands, writes the result.
- Long: Most common form: sed ‘s/old/new/g’ file — substitute every old with new. Other operations: delete lines (/pattern/d), print specific lines (-n ‘5,10p’), apply to a file in place (-i). sed is a quick way to do find-and-replace across many files without opening an editor.
- Why it matters to a defender: automated config fixes, log redaction, mass renames. Combined with find (find … -exec sed -i … {} \;) it scales to entire trees.
- First introduced in: Lesson 7
- Related: [awk], [grep], [find]
- Reference: man sed; GNU sed manual
xargs
- Hebrew: xargs
- Acronym: —
- Category: Shell composition
- Short: Reads items from stdin and runs a command with those items as arguments.
- Long: Bridges commands whose output is a list of names (find, ls, grep -l) into commands that take names as arguments. Example: find / -name “*.conf” -print0 | xargs -0 grep -l “password” — for each found config file, search inside for “password”. Use -0 with find -print0 to handle filenames containing spaces safely.
- Why it matters to a defender: bridges file-listing and content-search — a frequent need in IOC sweeps.
- First introduced in: Lesson 7
- Related: [find], [grep], [[pipe]]
- Reference: man xargs
Wildcard / Glob
- Hebrew: תווים כלליים / Glob
- Acronym: —
- Category: Shell expansion
- Short: Special characters the shell expands into matching filenames before running a command. * matches any string; ? matches any single character; [abc] matches one of the listed characters.
- Long: Globs are expanded by the SHELL, not the command — ls *.log is, by the time ls runs, ls a.log b.log c.log. Important consequence: a glob with no matches expands to itself (or to nothing, depending on shell options), and globs DO NOT recurse by default (*.log does not match subdirectories). For recursive matching use find.
- Why it matters to a defender: glob mistakes are a common source of unexpected behaviour — both benign (no matches) and dangerous (rm -rf $DIR/ when $DIR is empty becomes rm -rf /).
- First introduced in: Lesson 7
- Related: [shell], [find]
- Reference: man bash (Pathname Expansion section)
Editors and help
nano
- Hebrew: nano (עורך טקסט במסוף)
- Acronym: —
- Category: Terminal text editor
- Short: A beginner-friendly modeless terminal text editor. Shortcuts are listed at the bottom of the screen.
- Long: nano <file> opens (or creates) a file. The bottom two rows show the shortcut menu: ^O save (write out), ^X exit, ^W search (where is), ^K cut line, ^U paste. Unlike vim, there are no modes; what you type goes into the buffer immediately. The right starting editor for L7 learners; vim is introduced later.
- Why it matters to a defender: the simplest editor that’s available on virtually every Linux system. You’ll use it to fix configs during incident response.
- First introduced in: Lesson 7
- Related: [bash], [[cli]]
- Reference: man nano; https://www.nano-editor.org/
Manual Page (man)
- Hebrew: דף הוראות (man)
- Acronym: man = manual
- Category: Documentation
- Short: The built-in offline reference for every standard Linux command. Invoked as man <command>.
- Long: Manual pages are organised in sections: 1 (user commands), 2 (system calls), 3 (library functions), 5 (file formats), 7 (overviews), 8 (admin commands). Inside man, /word searches, n next match, q quits. The cousin command apropos <keyword> lists man pages matching a keyword. For tasks rather than reference, info <command> (texinfo) is often more thorough.
- Why it matters to a defender: the authoritative answer to “what does this flag do?” lives in man. Trust it over Stack Overflow.
- First introduced in: Lesson 7
- Related: [[cli]], [shell]
- Reference: man man
v2.1 NEW entries — processes and network
NEW Entry — ps
- Short: Linux command that reports process status. ps alone shows the current shell’s processes; ps aux shows every process on the system.
- Long: Columns include USER, PID, %CPU, %MEM, VSZ, RSS, TTY, STAT, START, TIME, COMMAND. Common patterns: ps aux | grep <name>, ps -p <PID>, ps aux –sort=-%cpu | head.
- Why: the foundational “what’s running on this box?” command. Every L1 SOC analyst uses it.
- Related: [[top]], [[kill]]
- Reference: man ps
NEW Entry — top
- Short: Live, refreshing view of running processes sorted by CPU usage. Press q to exit.
- Long: Interactive: M sort by memory, P sort by CPU, k kill a PID. Modern replacement: htop (friendlier UI). For one-shot snapshots use ps.
- Why: the live counterpart to ps. Useful for catching runaway processes or short-lived spikes.
- Related: [[ps]], [[htop]]
- Reference: man top
NEW Entry — ss
- Acronym: ss = “Socket Statistics”
- Short: Modern replacement for netstat. Shows network sockets.
- Long: Common flags: -t TCP, -u UDP, -l listening, -n numeric (no DNS), -p show process (requires root). Common pattern: ss -tuln lists all listening sockets; ss -tulnp adds PID/process name.
- Why: the foundational “what’s listening on this box?” command. SOC analysts use it constantly.
- Related: [[netstat-deprecated]], [[ip]]
- Reference: man ss; iproute2 project docs
NEW Entry — kill
- Short: Send a signal to a process. By default sends SIGTERM (15, graceful). kill -9 sends SIGKILL (immediate, ungraceful).
- Long: Variants: pkill -f <pattern> (by command pattern), killall <name> (by process name). Try SIGTERM first; only escalate to SIGKILL if the process doesn’t respond — SIGKILL doesn’t allow cleanup (files may stay locked).
- Why: primary tool for stopping rogue processes during IR.
- Related: [[ps]], [[signal]]
- Reference: man kill, man signal
UPDATED — Linux-CLI-Foundations (Badge)
- Short: CSRP badge awarded on passing the L7 Challenge “Linux CLI Master” — a multi-step CLI investigation using find, grep, cat, and base64 decode.
- Long: Confirms the learner can navigate the Linux filesystem, read/write files via CLI, compose commands with pipes and redirection, search with grep and find, inspect processes (ps/top) and network sockets (ss/ip/ping/curl), kill processes safely, and execute a multi-step CLI investigation. 7th badge in the CSRP sequence. The skill set every subsequent module assumes.
cyberPedia rendering notes
- Each entry above maps to a single cyberPedia page.
- The name is derived from the heading (slugified — e.g., “Filesystem Hierarchy Standard (FHS)” → fhs).
- Cross-links ([[term-slug]]) become hyperlinks within the cyberPedia.
- The “Short” field is used for tooltip previews; the “Long” field is the full page body.
- The “Why it matters to a defender” field is featured prominently — it’s what distinguishes this from a generic glossary.
- Terms tagged with First introduced in: Lesson N allow filtering by lesson progress.