shBash

Learn Bash – all lessons

15 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Terminal, Navigation & Files

Change folders, create, copy, move, delete and read files.

2

Pipes & Redirection

Chain programs and direct input/output into files.

3

Variables, Quoting & Arithmetic

Store values, set quotes correctly, command output and arithmetic.

4

Conditions: if, [[ ]] and case

Branching, file and text tests, comparisons and pattern matching.

5

Loops: for, while, until

Work through lists, number ranges, files and lines.

Intermediate
6

Functions

Reusable building blocks with arguments, local variables and return values.

7

Script Arguments & getopts

$1, $@, $#, shift, default values and parsing options.

8

grep, sed, awk & Co.

Filter, replace and analyze text – the tools for logs and CSV.

9

find, xargs & Bulk File Processing

Find files by name, age and size and apply commands to them.

10

Exit Codes, Error Handling & set -euo pipefail

Reliable scripts: detect errors, abort and clean up.

Advanced
11

Arrays, Associative Arrays & Parameter Expansion

Handle lists safely and split strings without external programs.

12

Here-Docs, Process Substitution & Debugging

Embed multi-line text, treat command output like files and debug scripts.

13

Processes, Jobs, Signals & trap

Background jobs, parallel execution, catching signals and cleaning up properly.

14

Script Best Practices & Portability

Robust, maintainable scripts: template, quoting, ShellCheck and the limits of Bash.

15

Automation with cron & a Practical Project

Run scripts on a schedule: crontab syntax, environment, logs and locks.