Bash / Shell Scripting
From your first `ls` to production-grade scripts: the 10 concepts that make you fluent in Unix shells — pipes, quoting, control flow, text processing, and safe scripting.
What is Bash?
A command interpreter and scripting language — the glue of Unix systems. You type commands; it runs programs, pipes data, and automates tasks.
Shell basics — navigation & files
The core commands you use every day: moving around the filesystem, listing, reading, copying, and inspecting files.
Pipes & redirections
Connect the output of one command to the input of another (`|`), or send it to a file (`>`, `>>`). The core composition tool of Unix.
Variables & quoting
Store values, interpolate them, and — most importantly — quote them to survive spaces, globs, and special characters.
Control flow — if, for, while, case
Branch on exit codes, loop over lists or streams, match patterns. Bash control flow is quirky — exit code 0 means true.
Functions & arguments
Group commands into reusable units, accept positional parameters, and return exit codes. Not quite like functions in 'real' languages.
Globbing & expansions
Wildcards for filenames, brace expansion for lists, parameter expansion for string ops. The shell rewrites your command line before running it.
Text processing — grep, sed, awk, cut, sort, uniq
The Unix data-wrangling toolkit. Compose these with pipes and you solve 90% of log/CSV/text tasks without writing a real program.
Scripts, shebang & safe defaults
A script is a file of commands. The shebang picks the interpreter; `set -euo pipefail` turns silent bugs into loud failures.
Signals, jobs & processes
Run commands in the background, wait on them, and handle Ctrl-C gracefully. The runtime side of shell scripting.