Unit 1
Moving around
Find out where you are, look around, and go places.
- 01Where am I?Your first commands: pwd, ls, and ~ for home.6 exercisesStart
- 02Going places with cdMove between folders: cd, paths with /, .. for up, and cd ~ for home.6 exercisesOpen
- 03Absolute paths and cd -Paths that start at the top of the disk, and cd - to go back.4 exercisesOpen
- 04Flags and hidden filesChange how a command behaves with flags: ls -a and ls -F.4 exercisesOpen
- 05Details and treesThe long listing with ls -l, combining flags, and tree.3 exercisesOpen
Unit 2
Files & folders
Make, write, copy, move, delete and read files.
- 06Make folders and filesmkdir, mkdir -p and touch.6 exercisesOpen
- 07Put words in a fileecho, double quotes, > to write into a file, and cat to read it.7 exercisesOpen
- 08Copy and movecp, cp -r for folders, and mv to rename and to move.4 exercisesOpen
- 09Delete files and foldersrm, rm -r and rmdir, and why there's no undo.4 exercisesOpen
- 10WildcardsMatch many files at once with * and ?, and what they skip.3 exercisesOpen
- 11Delete safelyPreview before rm, -- and ./ for odd names, cp -n so nothing is overwritten.5 exercisesOpen
- 12Read longer fileshead and tail for the start and end of a file, and less to scroll.3 exercisesOpen
Unit 3
Searching
Search inside files with grep, find files by name, and count.
- Search inside files with grepgrep, and its flags -i, -n and -v.4 exercisesPro
- Count matches and search foldersgrep -c to count, grep -r and . to search a whole folder.4 exercisesPro
- Find files by namefind with -name and -type.3 exercisesPro
- Count with wcCount lines, words and bytes with wc.3 exercisesPro
Unit 4
Pipes & redirects
Send output into files, chain commands, and read the help.
- Redirects>> to add to a file, 2> for error messages, and /dev/null.4 exercisesPro
- PipesConnect commands with |, so one command's output feeds the next.6 exercisesPro
- Chain commands and check exit codes; to run one after another, exit codes and $?, && and ||.7 exercisesPro
- Get helpRead a command's --help, search it with grep, and find your way around man pages.5 exercisesPro
- Both streams, and tee2>&1 and &> to capture everything; tee to save and see at once.5 exercisesPro
- Sort and countsort, sort -n, sort -r, uniq and uniq -c.7 exercisesPro
- Cut out columnscut -f to pick columns, cut -d to say what separates them.3 exercisesPro
Unit 5
Git basics
Track a project's history: status, add, commit, log, diff and undo.
- Start tracking with gitgit init, git status, git add and the short status.5 exercisesPro
- Your first commitgit add ., git diff --staged, git commit -m and git log --oneline.5 exercisesPro
- Keep secrets out of git.gitignore with single quotes, git check-ignore, git rm --cached and git log -S.5 exercisesPro
- Read the historygit log, git diff, git show, HEAD and HEAD~1, --name-only.6 exercisesPro
- Undo changesgit restore, git restore --staged, and git commit -a.3 exercisesPro
Unit 6
Supervising an AI coding agent
Spot dangerous commands, review what an agent changed, and undo its mistakes.
- Spot the dangerous commandRead an agent's plan before you approve it: unset variables, rm -rf, curl | sh, > vs >>.5 exercisesPro
- Review what the agent changedgit status -s, git diff --stat and git diff on one file.3 exercisesPro
- When the agent commits for youRanges: main..HEAD, --format=%s, main...HEAD and git show --stat.6 exercisesPro
- Undo the agent's mistakesrestore what you need, git revert, git reset --soft, and why not --hard.5 exercisesPro
Unit 7
Permissions & scripts
Read ls -l, change modes with chmod, and write and run your own scripts.
- Read permissionsWhat the first column of ls -l means, ls -ld, and who root is.5 exercisesPro
- chmod with numbersSet permissions with numbers like 644 and 600; sudo and redirects.5 exercisesPro
- chmod with lettersChange just one permission (go-w, u+x), whole folders with -R, and ls -lR.5 exercisesPro
- Run scriptsbash file, ./script, the shebang line, and chmod +x.4 exercisesPro
- Write your own scriptsWrite a file of several lines with a here-doc, and use $1, the first argument.3 exercisesPro
Unit 8
Text processing
Find and replace with sed, work with columns in awk, reshape text with tr and paste.
- sed: find and replacesed 's/old/new/', g for every match, -i to change the file, -i.bak to keep a backup.4 exercisesPro
- sed: pick and delete linessed -n 'Np', previews with s///p, deleting lines, and the patterns ^, .*, $ and \.8 exercisesPro
- awk: print columnsawk '{print $4}', several fields at once, and -F for commas.3 exercisesPro
- awk: filter and add upConditions like $3 >= 6 and NR > 1, maths in print, and totals with += and END.4 exercisesPro
- Feed files in with <, and tr< for input, tr to swap characters, tr -d to delete, tr -s to squeeze.4 exercisesPro
- paste, and sorting by a columnpaste files side by side, paste -d and -s, sort -k and -t.5 exercisesPro
Unit 9
Environment & control
Variables, the environment, PATH, aliases, processes and SSH keys.
- Shell variablesSet a variable with NAME=value, read it with $NAME, and quote it.2 exercisesPro
- The environmentexport for programs and scripts, env to list, unset to remove.3 exercisesPro
- PATH and commandsHow the shell finds commands: PATH, which, type, and aliases.6 exercisesPro
- Processes and SSH keysps aux, kill and kill -9, Ctrl-Z and bg, ssh and its keys.6 exercisesPro
Unit 10
Shell scripting
Arguments, if, loops, functions, and scripts that fail safely.
- Script arguments$1 and friends, $# to count them, "$@" and "$*" for all of them.4 exercisesPro
- Decisions with ifTests with [ ], -f and -d, comparing text with =, then if and else.5 exercisesPro
- More testsCompare numbers with -lt, -le and -gt; -z for empty; elif; and [[ ]].4 exercisesPro
- for loopsDo the same thing for every file, and quote "$f".4 exercisesPro
- while loops and functionsArithmetic with $(( )), while loops with a counter, and your own functions.3 exercisesPro
- Scripts that fail safelybash -c, set -euo pipefail, VAR=value for one command, ${VAR:?}, $( ) and mktemp.10 exercisesPro
Unit 11
Finding & bulk actions
Sharper find, acting on what it finds, and regular expressions with grep.
- Sharper find-iname, -mtime, -not and -maxdepth.5 exercisesPro
- Act on what find finds-exec … {} \; once per file, -exec … {} + all at once, and -delete.4 exercisesPro
- xargs and grep -lTurn a list into arguments with xargs, list matching files with grep -l, and handle spaces.3 exercisesPro
- Regular expressions with grep[0-9] classes, grep -o, -E with {4} and |, and grep -w.8 exercisesPro
Unit 12
Git branches & merging
Work on branches, merge them, and resolve conflicts.
Unit 13
Git history & undo
Reset modes, clean commits, the stash, cherry-pick and the reflog.
- reset --soft, --mixed, --hardMove a branch back and choose what happens to the changes.4 exercisesPro
- Commits a reviewer can readGood messages, git commit --amend, and splitting a commit in two.5 exercisesPro
- The stashPut unfinished work aside with git stash, label it, list it, and bring it back.6 exercisesPro
- Copy one commit: cherry-pickgit cherry-pick a commit from another branch, and continue after a conflict.2 exercisesPro
- The reflog remembersgit reflog, HEAD@{1}, and getting lost commits back with git reset --keep.3 exercisesPro
Unit 14
Working with remotes (simulated)
Clone, fetch, push and pull, and force-push safely.
- Clone and fetchgit clone, git remote -v, git fetch, origin/main and tracking branches.5 exercisesPro
- Push and pullgit push -u, git pull --ff-only, and pull --no-rebase when both sides moved.4 exercisesPro
- Force-push safely--force-with-lease, git rev-parse, and pinning the lease to the commit you reviewed.4 exercisesPro
Unit 15
Logs & data on the command line
Slice log files and read JSON with jq.
Unit 16
Capstone: supervising an AI agent
Run the full review gate, limit what an agent may do alone, and recover from a bad session.
- The review gateEvery commit, the combined change, leftovers, secrets, undo, tests, push the branch.6 exercisesPro
- What an agent may do aloneLeast privilege: read-only auto-approval, no --no-verify, disposable checkouts, no production keys.5 exercisesPro
- Recover from an agent's mistakesUse the reflog to undo a destructive session, safely, and refuse "cleanups" mid-recovery.5 exercisesPro