Cheatsheet Pages
One command, one real-world scenario, one page. Every page answers a single question developers actually search for, with a command copied from a tested, open-source cheatsheet — no invented flags, no untested syntax.
Git Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/git-cheatsheet
- How to set your Git username and email — git config
- How to make main the default branch for new Git repos
- How to see what has changed in Git, compactly — git status -sb
- How to stage only part of a file in Git — git add -p
- How to fix the last Git commit — git commit --amend
- How to view Git history as a graph — git log --oneline --graph
- How to unstage a file in Git and keep your edits — git restore --staged
- How to discard local changes in a file — git restore (permanent)
- How to undo the last commit in Git — git reset --soft vs --mixed vs --hard
- How to undo a pushed commit safely — git revert
- How to list all branches in Git, local and remote — git branch -a / -vv
- How to create and switch to a new branch in Git — checkout -b / switch -c
- How to delete a Git branch locally and on the remote
- How to rebase your branch onto the latest main in Git
- How to squash or reword recent commits — git rebase -i
- How to finish or cancel a Git rebase — --continue / --abort
- How to stash unfinished work in Git — git stash push
- How to list, restore and drop Git stashes — pop vs apply
- How to check which URL a Git remote points to — git remote -v
- How to clean up stale remote branches in Git — git fetch --prune
- How to pull with rebase instead of merge — git pull --rebase
- How to push a branch and set its upstream — git push -u
- How to recover a lost commit in Git — git reflog
- How to copy one commit onto your branch — git cherry-pick
- How to find the commit that broke your code — git bisect
SQL Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/sql-cheatsheet
- How to filter rows in SQL — WHERE
- How to get the top N rows in SQL — ORDER BY ... LIMIT
- How to remove duplicate values from a result — SELECT DISTINCT
- How to match text patterns in SQL — LIKE % and _
- How to filter by a set or a range in SQL — IN / BETWEEN
- How to count, sum and average in SQL — COUNT / SUM / AVG
- How to compute per-group statistics in SQL — GROUP BY
- HAVING vs WHERE in SQL — filtering groups, not rows
- How to count with conditions in SQL — CASE WHEN inside aggregates
- INNER JOIN in SQL — only rows that match in both tables
- LEFT JOIN in SQL — keep every row of the left table
- How to find rows with no match in SQL — LEFT JOIN ... IS NULL
- How to join a table to itself in SQL — self join for org charts
- How to join three tables and aggregate in SQL — orders per department
- How to compare rows against an overall average in SQL — scalar subquery
- How to check that a related row exists in SQL — EXISTS
- How to name an intermediate result in SQL — WITH (CTE)
- How to rank rows inside groups in SQL — RANK() OVER (PARTITION BY ...)
- How to insert a row in SQL — INSERT INTO ... VALUES
- How to update rows in SQL — UPDATE ... WHERE (and the mistake that updates the whole table)
- How to delete rows in SQL — DELETE ... WHERE
- How SQL transactions work — BEGIN / COMMIT / ROLLBACK
- How to upsert in SQL — INSERT ... ON CONFLICT DO UPDATE
- How to create a table in SQL — CREATE TABLE with keys and foreign keys
- How to speed up frequent lookups in SQL — CREATE INDEX
kubectl Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/kubectl-cheatsheet
- How to check which cluster kubectl is talking to — kubectl cluster-info
- How to list every pod in every namespace — kubectl get pods -A
- How to find out why a pod is pending or crashing — kubectl describe
- How to see cluster events in order — kubectl get events --sort-by
- How to check live CPU and memory usage — kubectl top
- How to deploy or update from a manifest — kubectl apply -f
- How to create a deployment in one line — kubectl create deployment
- How to change a deployment's replica count — kubectl scale
- How to update a deployment's image — kubectl set image
- How to restart all pods of a deployment — kubectl rollout restart
- How to watch a rollout until it finishes — kubectl rollout status
- How to roll back a deployment — kubectl rollout history / undo
- How to read a pod's logs — kubectl logs
- How to follow pod logs live — kubectl logs -f --tail
- How to get logs from a crashed container — kubectl logs -p (CrashLoopBackOff)
- How to open a shell inside a running container — kubectl exec -it
- How to copy files in and out of a container — kubectl cp
- How to query resources by label — kubectl get pods -l
- How to delete pods and deployments — kubectl delete
- How to access a cluster service from your laptop — kubectl port-forward
- How to list the clusters you can reach — kubectl config get-contexts
- How to switch Kubernetes clusters — kubectl config use-context
- How to list and create namespaces — kubectl get ns / create namespace
- How to set a default namespace and stop typing -n — kubectl config set-context
- How to debug a running pod without restarting it — kubectl debug
FFmpeg Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/ffmpeg-cheatsheet
- How to install FFmpeg and check which codecs your build has
- How to convert any video to MP4 (H.264 + AAC) — ffmpeg
- How to convert MP4 to WebM (VP9 + Opus) — ffmpeg
- How to convert MKV to MP4 without re-encoding — ffmpeg remux
- How to compress a video with FFmpeg — CRF explained
- FFmpeg presets: trade encoding speed for file size
- How to encode a video to an exact file size — two-pass FFmpeg
- How to extract audio from a video as MP3 — ffmpeg
- How to extract audio from a video as M4A (AAC) — ffmpeg
- How to extract audio without re-encoding — ffmpeg -c:a copy
- How to turn a video into a good-looking GIF — the ffmpeg palette trick
- How to cut a clip out of a video, fast — ffmpeg -ss before -i
- How to cut a video frame-accurately — ffmpeg -ss after -i
- How to join videos without re-encoding — ffmpeg concat
- How to resize a video to 720p — ffmpeg scale filter
- How to resize a video by width and keep the aspect ratio — ffmpeg
- How to crop a region out of a video — ffmpeg crop
- How to put a watermark on a video — ffmpeg overlay
- How to burn subtitles into a video — ffmpeg subtitles filter
- How to add text to a video without extra files — ffmpeg drawtext
- How to grab a thumbnail frame from a video — ffmpeg
- How to export video frames as images — ffmpeg fps filter
- How to replace a video's audio track — ffmpeg -map
- How to stream a file to YouTube Live or Twitch — ffmpeg RTMP
- How to batch-convert a folder of videos — ffmpeg shell loops
Docker Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/docker-cheatsheet
- How to download a Docker image — docker pull
- How to list Docker images on your machine — docker images
- How to build a Docker image from a Dockerfile — docker build
- How to tag and push a Docker image to a registry
- How to delete Docker images and reclaim disk — rmi and image prune
- How to run a Docker container — docker run with ports and volumes
- How to list Docker containers — docker ps and ps -a
- How to start, stop and restart a Docker container
- How to delete a Docker container — docker rm
- How to run a throwaway Docker container — docker run --rm
- How to open a shell inside a running container — docker exec -it
- How to read a container's logs — docker logs -f --tail
- How to copy files in and out of a container — docker cp
- How to keep data in Docker volumes — create, list, delete
- How to connect containers on a Docker network
- The Dockerfile instructions that matter — FROM, WORKDIR, COPY, RUN, EXPOSE, CMD
- A minimal working Dockerfile — a Python app, built and run
- How to start and stop a multi-container app — docker compose up and down
- How to operate a running Compose stack — ps, logs, exec
- Sample compose.yaml — a web service with a Postgres database
- How to clean up everything unused in Docker — docker system prune
- How to remove only stopped containers — docker container prune
- How to inspect a Docker object — docker inspect
- How to see what a container is doing — docker stats and docker top
- Container won't start? The three-step Docker drill
curl Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/curl-cheatsheet
- How to make a GET request with curl
- How to POST JSON with curl
- How to replace a resource with curl — PUT
- How to delete a resource with curl — DELETE
- How to partially update a resource with curl — PATCH
- How to check a URL's headers without downloading the body — curl -I
- How to send custom headers with curl — -H
- How to call an API with a Bearer token — curl Authorization header
- How to use Basic auth with curl — -u
- How to set a custom User-Agent with curl — -A
- How to POST form data with curl — and let curl URL-encode it
- How to upload a file with curl — -F multipart form
- How to see response headers with curl — -i
- How to save curl output to a file — -o vs -O
- How to silence curl's progress bar but keep the errors — -sS
- How to measure response time and status code with curl — -w
- How to see the whole HTTP conversation — curl -v
- How to get a full curl trace — --trace-ascii
- How to check which HTTP version curl negotiated — %{http_version}
- How to skip TLS certificate checks with curl — -k (debug only)
- How to resume an interrupted download with curl — -C -
- How to limit curl's download speed — --limit-rate
- How to make curl retry failed downloads — --retry
- How to log in once and reuse the session with curl — cookie jars
- How to route curl through a proxy — HTTP and SOCKS5
Regex Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/regex-cheatsheet
- What does . match in regex? Any character except a newline
- Regex shorthands: \d for digits, \w for word characters, \s for whitespace
- How to anchor a regex to the start or end — ^ and $
- How to match whole words only in regex — \b word boundary
- Regex quantifiers * + ? — zero or more, one or more, optional
- How to repeat a pattern an exact number of times — {n}, {n,}, {n,m}
- Greedy vs lazy matching in regex — .* vs .*?
- How to match one character from a set — [...] and [^...]
- How to match this or that in regex — | alternation
- How to capture parts of a match — (...) groups
- How to name a capture group — (?<name>...)
- How to group without capturing — (?:...)
- How to match the same text twice — backreferences with \1
- Lookahead in regex: require (or forbid) what follows — (?=...) and (?!...)
- Lookbehind in regex: require (or forbid) what precedes — (?<=...) and (?<!...)
- A practical regex for email addresses
- A practical regex for finding URLs in text
- A loose regex for international phone numbers
- A strict regex for IPv4 addresses — every octet really 0-255
- A regex for dates in YYYY-MM-DD format
- A quick regex for HTML tags — and when not to use it
- How to trim leading and trailing whitespace with regex
- Backreferences in replacements — $1 vs \1, and grep -P in the terminal
- Catastrophic backtracking: the regex that hangs — and the fix
- Why you should not parse HTML with regex
jq Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/jq-cheatsheet
- How to pretty-print JSON with jq
- How to extract one field from JSON with jq
- How to get strings without quotes from jq — -r raw output
- How to print one JSON object per line with jq — -c
- How to drill into nested JSON objects with jq
- How to index into and stream JSON arrays with jq
- How to count things in JSON with jq — length
- How to filter JSON rows by a number with jq select
- How to filter JSON by exact string match with jq select
- How to combine conditions in jq — and, or, not
- How to pluck one field from every element with jq map
- How to keep only some fields of every object with jq map
- How to add a computed field to every JSON object with jq
- How to chain jq filters with pipes
- How to build new JSON objects with jq
- How to convert types and split or join strings with jq
- How to match strings with a regex inside jq — test()
- How to sort JSON objects by a field with jq — sort_by
- How to deduplicate values with jq — unique
- How to group and count JSON data with jq — group_by
- How to sum numbers in JSON with jq — add
- How to find the top or bottom object by a field with jq — max_by and min_by
- How to inspect and trim JSON object keys with jq — keys, has, del
- jq in the real world: shape API responses and count log levels
- How to pass shell variables into jq safely — --arg — and slurp many documents with -s
SSH Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/ssh-cheatsheet
- How to connect with SSH — custom ports and login names
- How to log in with a specific SSH key — ssh -i
- How to debug a failed SSH login — ssh -v
- How to stop SSH sessions from freezing — ServerAliveInterval keepalive
- How to kill a frozen SSH session — the Enter ~. escape
- How to create an SSH key pair — ssh-keygen with Ed25519
- How to install your public key on a server — ssh-copy-id
- How to type your key passphrase once per session — ssh-agent and ssh-add
- How to change a key's passphrase — and the file permissions SSH demands
- How to stop typing addresses — ~/.ssh/config host aliases
- How to set SSH defaults for every host — the Host * block
- How to fix SSH 'Too many authentication failures' — IdentitiesOnly
- How to configure a whole fleet with SSH wildcard hosts
- How to bring a remote port to your machine — ssh -L local forwarding
- How to expose your local app through a server — ssh -R remote forwarding
- How to turn SSH into a SOCKS proxy — ssh -D dynamic forwarding
- How to run an SSH tunnel in the background — -fN
- How to reach a server through a bastion — ssh -J
- How to bake a jump host into your SSH config — ProxyJump
- How to copy files with scp — both directions, custom ports, whole directories
- How to sync a directory tree over SSH — rsync -e ssh
- How to browse and move files interactively — sftp
- How to disable direct root login over SSH — PermitRootLogin
- How to turn off SSH password authentication — keys only
- How to restrict who can log in — AllowUsers, MaxAuthTries, and changing the port safely
Terminal Superpowers — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/terminal-superpowers-cheatsheet
- cmux — the terminal built for AI coding agents
- yoinks — download videos from your terminal
- zoxide — a smarter cd that remembers where you go
- fzf — fuzzy-find files, history and processes as you type
- fd — find files without fighting find's syntax
- ripgrep — grep, rebuilt in Rust
- tmux — terminal sessions that survive disconnects
- zellij — a modern terminal workspace, tmux with training wheels
- starship — a shell prompt that tells you things
- eza — ls with colors, icons and git status
- bat — cat with syntax highlighting and line numbers
- lazygit — git, without the memorization
- tldr — man pages you will actually read
- btop — a resource monitor worth looking at
- The terminal starter pack — install the whole set with one Homebrew command
- Jump and find: zoxide + fzf for terminal navigation
- Find files, then search inside them — fd + ripgrep
- Read files properly: eza to list, bat to view
- tmux vs zellij — which terminal multiplexer?
- A git workflow that stays in the terminal — lazygit + starship
- Remote work over SSH — tmux sessions plus zoxide jumps
- Watch the machine while you work — btop in a tmux pane
- New in 2026: cmux and yoinks
- Replace the classics: find, ls, cat and grep — with fd, eza, bat and ripgrep
- Learn any command fast — tldr examples plus fzf history search
Adobe Free Alternatives — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/adobe-free-alternatives-cheatsheet
- Free alternative to Photoshop — PhotoCraft (early alpha)
- Free alternative to Illustrator — VectorCraft (early alpha)
- Free alternative to Premiere Pro — FilmCraft (early alpha)
- Free alternative to Lightroom — LightCraft (early alpha)
- Free alternative to Acrobat — PrintCraft (early alpha)
- Free alternative to After Effects — EffectCraft (early alpha)
- Free alternative to InDesign — DesignCraft (early alpha)
- Free alternative to Photoshop — GIMP (mature)
- Free alternative to Illustrator — Inkscape (mature)
- Free alternative to Premiere Pro — DaVinci Resolve (mature)
- Free alternative to Premiere Pro — Kdenlive (mature)
- Free alternative to Lightroom — darktable (mature)
- Free alternative to Audition — Audacity (mature)
- Free alternative to After Effects — Blender (mature)
- Free alternative to Figma and Adobe XD — Penpot (mature)
- Free alternative to InDesign — Scribus (mature)
- Free alternatives to Photoshop — PhotoCraft and GIMP
- Free alternatives to Illustrator — VectorCraft and Inkscape
- Free alternatives to Premiere Pro — FilmCraft, DaVinci Resolve and Kdenlive
- Free alternatives to Lightroom — LightCraft and darktable
- Free alternatives to After Effects — EffectCraft and Blender
- Free alternatives to InDesign — DesignCraft and Scribus
- The ArtCraft suite — seven Rust apps that replace the Adobe suite
- The mature free creative suite — GIMP, Inkscape, Kdenlive, darktable, Audacity, Blender, Scribus
- How to install the free Adobe alternatives on Linux
Desubscribe — Free SaaS Alternatives — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/desubscribe-cheatsheet
- Replace Notion Plus ($120/yr) with AppFlowy — free and self-hosted
- Replace Slack Pro ($87/yr per person) with Mattermost — save $87 a year
- Replace Figma Professional ($144/yr per editor) with Penpot — save $144 a year
- Replace Google One 2TB ($100/yr) with Immich — save $100 a year
- Replace 1Password ($48/yr) with Vaultwarden — save $48 a year
- Replace Dropbox Plus ($120/yr) with Nextcloud — save $120 a year
- Replace Airtable Team ($240/yr per seat) with NocoDB — save $240 a year
- Replace Trello Premium ($120/yr per person) with Wekan — save $120 a year
- Replace Zoom Pro ($150/yr) with Jitsi Meet — save $150 a year
- Replace Evernote Personal ($130/yr) with Joplin — save $130 a year
- How to install Wekan with its MongoDB — the full command set
- How much do the 10 swaps save in total? About $1,260 a year
- What does a 10-person team save? $4,470 a year on three tools alone
- What do subscriptions really cost? $6,300 over five years
- Replace your notes stack — Notion + Evernote with AppFlowy + Joplin (save $250/yr)
- Replace your file stack — Google One + Dropbox with Immich + Nextcloud (save $220/yr)
- Replace your team stack — Slack + Trello with Mattermost + Wekan (save $207/yr per person)
- Replace meetings and design — Zoom + Figma with Jitsi + Penpot (save $294/yr)
- The three biggest subscription savings — Airtable, Zoom, Figma ($534/yr)
- The two easiest swaps to start with — 1Password and Slack ($135/yr)
- What do you need to self-host all of this? One small server
- Are these subscription prices still current?
- Do the 'free' replacements have paid tiers? The honest note
- Replace passwords and business data — 1Password + Airtable with Vaultwarden + NocoDB (save $288/yr)
- Run all 10 free replacements on one VPS — every install command
Vim Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/vim-cheatsheet
- How to save and quit in Vim — :w, :q, :wq and ZZ
- How to quit Vim and throw your changes away — :q! and ZQ
- How to quit Vim without touching an unchanged file — :x vs :wq
- How to save a file in Vim that you forgot to open with sudo — :w !sudo tee %
- How to open a file in Vim at a line number or a match — vim +42, vim +/pattern
- How to move in Vim — h j k l and w b e
- How to jump to a line or line anchor in Vim — 0 ^ $, gg G, :42
- How to find a character on the current line in Vim — f F t T with ; and ,
- How to jump to a matching bracket or the next paragraph in Vim — % and { }
- How to scroll and jump around the screen in Vim — Ctrl-d/u/f/b and H M L
- How to enter insert mode in Vim, six ways — i a I A o O
- How to delete, copy and paste lines in Vim — dd, yy, p with counts
- How to undo, redo and repeat in Vim — u, Ctrl-r and .
- How Vim's editing grammar works — operators d / c / y plus a motion
- How to edit with Vim text objects — ciw, ci", dap, di(
- How to search in Vim — / ?, n N, and * #
- How to find and replace on the current line in Vim — :s with g and c flags
- How to find and replace across a file or a line range in Vim — :%s and :12,20s
- How to control case and highlighting when searching in Vim — \c, smartcase, :noh
- How to act on every matching line in Vim — :g/pattern/d and :v
- How to select text in Vim — the three visual modes v, V, Ctrl-v
- How to insert the same text on many lines in Vim — Ctrl-v then I, and $ A
- How to record and replay Vim macros — q to record, @ to play
- How to use Vim registers — named registers and the system clipboard
- A survival ~/.vimrc — four settings that pay off daily
tmux Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/tmux-cheatsheet
- How to create a named tmux session — tmux new -s
- How to list tmux sessions and reattach — tmux ls, tmux attach -t
- How to detach from tmux and leave everything running — prefix d
- How to end a tmux session for good — tmux kill-session -t
- How to open and rename tmux windows — prefix c, prefix ,
- How to switch tmux windows — prefix n / p, digits, and the window list
- How to kill the current tmux window — prefix &
- How to reorder tmux windows — swap-window and move-window
- How to split tmux panes — prefix % side-by-side, prefix " top-and-bottom
- How to move between tmux panes — arrow keys, prefix o, prefix q
- How to zoom a tmux pane full-screen (and back) — prefix z
- How to swap tmux panes and cycle layouts — prefix { }, prefix Space
- How to resize tmux panes — prefix Alt-arrow, or resize-pane
- How to kill a tmux pane, or break it out into its own window — prefix x, prefix !
- How to scroll back and search in tmux — copy mode, prefix [
- How to copy text in tmux copy mode — emacs and vi keys
- How to paste in tmux — prefix ], and the buffer stack
- How to print a tmux pane's contents to stdout — tmux capture-pane -p
- How to change the tmux prefix key — Ctrl-b to Ctrl-a
- How to turn on tmux mouse support — set -g mouse on
- tmux config basics — bigger history, 1-based indexes, auto-renumber
- How to reload your tmux config without restarting — prefix r
- Friendlier tmux split keys that keep your directory — config bindings
- How to drive tmux from scripts — detached sessions and send-keys
- How to browse tmux sessions visually — choose-tree (and kill-server, the last resort)
systemd Cheatsheet — 25 pages
Full cheatsheet: https://github.com/Ezra-Zhao/systemd-cheatsheet
- How to check whether a service is running, failed or dead — systemctl status
- How to start or stop a systemd service right now — systemctl start / stop
- systemctl restart vs reload — which one does your change need?
- How to control whether a service starts at boot — systemctl enable / disable
- How to enable and start a service in one step — systemctl enable --now
- How to ask systemd yes/no questions in scripts — is-active, is-enabled, is-failed
- How to ban a systemd unit from starting at all — systemctl mask / unmask
- How to make systemd re-read unit files after you edit them — systemctl daemon-reload
- How to show one unit's logs — journalctl -u
- How to follow systemd logs live — journalctl -f
- How to read logs from a previous boot — journalctl -b
- How to cut a time window out of the journal — journalctl --since / --until
- How to filter journal logs by priority — journalctl -p err
- How to see and shrink the systemd journal's disk use — --disk-usage, --vacuum-time
- How to see a unit exactly as systemd sees it — systemctl cat
- Anatomy of a systemd .service unit file — a complete, verified example
- How to override a systemd unit without editing the vendor file — systemctl edit
- How to see a unit's dependency tree — systemctl list-dependencies
- How to find and clear failed systemd units — systemctl --failed, reset-failed
- How to list every systemd timer and its next run — systemctl list-timers --all
- Anatomy of a systemd .timer — a daily job and its service
- How to test a systemd calendar expression before you ship it — systemd-analyze calendar
- How to enable a systemd timer — enable the TIMER, not the service
- How to find where boot time went — systemd-analyze blame and critical-chain
- hostnamectl, timedatectl, localectl — set hostname, time and locale