Terminal guides you can try.
Short, practical explanations of the commands you'll use every week. Every example ran in our practice shell, and you can open a terminal right on the page to try it yourself.
Terminal basics
- Terminal basics
Basic terminal commands for beginners
The terminal commands you use every day, with real output: pwd, ls, cd, mkdir, touch, cp, mv, rm, cat, head and tail.
8 examples you can try
- Terminal basics
.gitignore and keeping secrets out of git
How .gitignore works, why it doesn't affect tracked files, how to stop tracking .env with git rm --cached, check-ignore, git log -S, and what to do about a leaked key.
5 examples you can try
- Terminal basics
chmod explained: Linux file permissions
How to read ls -l permissions and change them with chmod: what rwx, 644, 755, 600 and u+x mean, chmod -R, and fixing Permission denied on scripts.
7 examples you can try
- Terminal basics
set -euo pipefail: bash scripts that fail safely
What set -e, set -u and set -o pipefail do, plus ${VAR:?}, "$@", -- and mktemp with trap: the habits that stop a bash script before a mistake deletes things.
6 examples you can try
Finding & filtering
- Finding & filtering
grep command examples
Practical grep examples with real output: search a file, ignore case, show line numbers, invert matches, search folders with -r and count matches.
8 examples you can try
- Finding & filtering
The find command and wildcards
How to find files by name with find -name and -type, and how the * and ? wildcards work in commands like ls *.txt.
6 examples you can try
- Finding & filtering
Pipes and redirection in bash
How > , >>, 2>, 2>/dev/null and the pipe | work in bash, with real output.
9 examples you can try
- Finding & filtering
sed command examples: find and replace
Practical sed examples with real output: replace text, replace every match with g, edit files in place with -i, print or delete lines, plus tr and sort.
8 examples you can try
- Finding & filtering
awk command examples: columns, filters and sums
Learn awk with real output: print columns, split CSV files with -F, skip headers with NR, filter rows by value and add up a column with END.
7 examples you can try
- Finding & filtering
find -exec and xargs examples
Run a command on every file find matches: -exec with \; or +, xargs, -mtime for old files, -iname and -not, and previewing before you delete.
8 examples you can try
- Finding & filtering
Analyze log files on the command line
Answer questions about a log file from the terminal: tail -n, grep errors, count with grep -c, top-N with sort | uniq -c, time windows, and JSON with jq.
8 examples you can try
Scripting & automation
- Scripting & automation
Environment variables and PATH in bash
Set and use shell variables, export them to scripts, add a folder to PATH, find commands with which and type, and chain commands with exit codes.
10 examples you can try
- Scripting & automation
Bash if statements: if, elif, else and test
Write bash if statements with real examples: if, elif and else, file tests like -f and -d, empty strings with -z, and comparing text and numbers.
8 examples you can try
- Scripting & automation
Bash for loop examples
Bash for loop examples with real output: loop over words, files and number ranges, handle file names with spaces, use while loops, and write functions.
8 examples you can try
Git
- Git
Git basics: init, add, commit, log and diff
A beginner's walkthrough of everyday git: git init, status, add, commit -m, log, diff and diff --staged, with real output you can try in a browser terminal.
9 examples you can try
- Git
git reset vs revert vs restore (and how to undo the last commit)
When to use git restore, git revert and git reset (--soft, --mixed, --hard), and the safe and destructive ways to undo your last commit.
7 examples you can try
- Git
How to resolve a git merge conflict
Resolve git merge conflicts step by step: read the <<<<<<< markers, fix the file, git add, commit, or back out with git merge --abort.
8 examples you can try
- Git
git stash: save unfinished work for later
How git stash works: shelve uncommitted changes, name them with -m, list them, bring them back with pop or apply, and drop old entries.
8 examples you can try
- Git
git cherry-pick: copy one commit to another branch
Use git cherry-pick to copy a single commit, like a bug fix, onto another branch.
7 examples you can try
- Git
How to undo git reset --hard
Recover commits after git reset --hard with git reflog and HEAD@{n}, what --soft, --mixed and --hard keep, and why uncommitted changes can't come back.
7 examples you can try
- Git
git push and git pull explained
How git clone, fetch, pull and push work: set an upstream with push -u, fix a rejected push, and why --force-with-lease beats --force.
7 examples you can try
AI coding agents
- AI coding agents
How to review changes made by an AI coding agent
A git checklist for reviewing an AI agent's work: status, diff --stat, diff, log and show.
8 examples you can try
- AI coding agents
Dangerous shell commands to never run (or approve)
Commands that destroy files, history or security: rm -rf with variables, curl | sh, chmod 777, git push --force, git clean, --no-verify and sudo.
6 examples you can try