🔧 Tools & Platforms
Linux Command Line Essentials
The command line is the backbone of Linux system administration, providing direct, scriptable access to the operating system that no GUI can match. Bresnahan and Blum present the shell — typically Bash — as the primary interface for navigating the filesystem, managing files, configuring services, and automating tasks. Understanding the shell means understanding how Linux processes commands: parsing the command line, expanding variables and globs, executing programs, and connecting them through pipes and redirects. Every GUI tool on Linux ultimately calls the same commands available at the shell, making CLI proficiency the foundation that unlocks everything else.
2
Minutes
2
Concepts
+45
XP
1
How It Works
  1. Shell basics and command structure — Every command follows the pattern command [options] [arguments]. Options modify behavior (short -l or long --long), arguments specify targets. The shell parses this line, performs expansions (variables, globs, command substitution), and then executes the resulting command.
  1. Environment variables — The shell maintains key-value pairs that configure behavior: PATH (where to find executables), HOME (user's home directory), SHELL (default shell), PS1 (prompt format). Set with export VAR=value, view with env or echo $VAR. Understanding PATH is essential — it determines which version of a command runs.
  1. Pipes and redirects — The composability model that makes Unix powerful:
  • | (pipe) — sends stdout of one command to stdin of the next: cat log.txt | grep ERROR | wc -l
  • > — redirect stdout to a file (overwrite): ls > files.txt
  • >> — redirect stdout to a file (append): echo "entry" >> log.txt
  • 2> — redirect stderr: command 2> errors.txt
  • 2>&1 — merge stderr into stdout: command > all.txt 2>&1
  1. Command chaining — Execute commands conditionally:
  • && — run next command only if previous succeeded: make && make install
  • || — run next command only if previous failed: ping host || echo "unreachable"
  • ; — run next command regardless: cd /tmp; ls
  1. Essential navigation and information commandspwd (current directory), cd (change directory), ls (list contents), man (manual pages), which (locate command), history (command history), alias (create shortcuts). Tab completion accelerates all of these — pressing Tab auto-completes file paths and command names.