A scannable, working-shelf reference for everything you actually use in Terminal and iTerm2 — plus copy-paste startup scripts for your live projects.
MACOS · APPLE SILICON
SONOMA / SEQUOIA · 2026
LAST REVIEWED 2026.05.13
▣ Click-to-copy Every command in this guide copies on click. Tables, inline code, code blocks — all of it. Hover over a <pre> block and the Copy button appears. Brief green flash confirms it landed in your clipboard.
NEW
00Start here · the basics
Truly entry-level. The commands you use before you even think about them. If anything here feels new, run it once and watch what happens. Nothing destructive on this page.
Where am I & what's here?
Command
What it does — try it first
pwd
Print working directory. Tells you where you currently are. The "you are here" pin.
ls
List files in the current folder.
ls -la
List everything — including hidden files (the ones starting with a dot). Plus sizes, dates, permissions.
ls -lah
Same as above but human-readable sizes (KB, MB instead of bytes). Daily driver.
tree -L 2
See the folder structure 2 levels deep. brew install tree if you don't have it.
clear
Wipe the screen so you can think again. Or just hit Cmd+K.
Move around folders
Command
What it does
cd ~
Go home. (~ is shorthand for your home folder — /Users/jyecemaybury.)
cd ..
Go up one folder.
cd ../..
Go up two.
cd -
Go back to the previous folder you were in. Toggle-style.
cd /
Go to the root of the whole machine. (Usually you don't need this.)
cd Desktop
Go into a folder by name (from where you are right now).
cd ~/Downloads
Go to a specific folder from anywhere using its full path.
Tab completion is your friend. Type cd ~/Down and hit Tab — it'll autocomplete to Downloads/. Type a few letters of any filename and tab. If there are multiple matches, double-tap Tab to see them all.
Your actual project folders — copy & paste
Command
Goes to
cd ~
Home (/Users/jyecemaybury)
cd "~/Random CLaude/Random Projects and Thoughts"
This workshop folder. Quotes needed because of the space.
cd ~/NervaHous
NervaHous brand + content
cd ~/studiohous
Studio Hous (creative arm)
cd ~/Trading/NHous_TBOT
The trading bot
cd ~/PermitPilot
EntitleFlow / PermitPilot
cd ~/.claude/skills
Local Claude skills (designdna lives here)
cd ~/Obsidian-Vaults/JeneX
The JeneX vault
cd ~/"Mission Control-JeneX"
Mission Control
Open things from the terminal
Command
What it does
open .
Open the current folder in Finder. The dot means "here". You'll use this constantly.
open ~/Downloads
Open any specific folder in Finder.
open file.pdf
Open a file with whatever the default app is.
open -a "Visual Studio Code" .
Open the current folder in VS Code.
code .
Same thing, shorter — if you have the code command installed (VS Code → Cmd+Shift+P → "Install 'code' command").
open -R file.txt
Show a file in Finder without opening it (reveal).
open https://github.com
Open a URL in your default browser.
Make, move, delete
Command
What it does
mkdir newfolder
Create a new folder.
mkdir -p a/b/c
Create a nested chain in one go. The -p means "make parents too, don't error if they exist."
touch file.txt
Create an empty file. Or update an existing one's timestamp.
cp original.txt copy.txt
Copy a file.
cp -r folder copy-of-folder
Copy a folder (the -r = recursive, copies contents too).
mv oldname.txt newname.txt
Rename a file. Same command moves: mv file.txt ~/Desktop/.
rm file.txt
Delete a file. No trash — gone immediately.
rm -r folder
Delete a folder + everything in it. Be sure.
The terminal does not use Trash.rm is permanent. If you want trash-like behavior, install trash (brew install trash) and use trash file.txt instead — that puts it in the Mac's actual Trash where you can recover.
Read & peek at files
Command
What it does
cat file.txt
Dump the whole file to the screen.
less file.txt
Open a file for scrolling. Space = next page, q = quit, /word = search.
head file.txt
First 10 lines.
head -n 30 file.txt
First 30 lines.
tail file.txt
Last 10 lines.
wc -l file.txt
Count lines in a file.
Getting unstuck mid-command
Keys
What it does
Ctrl+C
The universal "stop this". Kills whatever's currently running. Use it the moment something feels wrong.
Ctrl+L or clear
Clear the screen, keep scrollback.
Cmd+K
Wipe scrollback entirely (Terminal app shortcut).
↑ arrow
Previous command. Keep pressing to walk back through history.
exit or Ctrl+D
Close the shell / terminal tab.
which python3
"Which program runs when I type this?" Shows the full path to the binary.
The one-line "start a session" template
# open a folder, see what's there, see hidden files too
cd ~/your-project && pwd && ls -lah
# open the current folder in Finder AND VS Code at the same time
open . && code .
# the "drop me into a Python project and start working" sequence
cd ~/your-project && source .venv/bin/activate && code . && claude
The && trick. Two ampersands mean "do this, then if it succeeded, do the next thing." Chain them to run multiple commands as one line. If any step fails, the chain stops — that's a feature, not a bug.
00bProject startup scripts
Drop these into ~/.zshrc or save the long ones as functions. source ~/.zshrc after, then just type the alias name.
NHous T-BOT /Trading/NHous_TBOT
Python multi-agent ICC trading system — Orchestrator + 5 specialized agents. Active build, paper-trading loop next.
# one-shot startup
cd ~/Trading/NHous_TBOT && source .venv/bin/activate && code . && claude
# alias (drop in ~/.zshrc)
alias tbot="cd ~/Trading/NHous_TBOT && source .venv/bin/activate && echo '⚡ T-BOT ready' && python --version"# run the skeleton
python icc_multi_agent_skeleton.py
# open the project HTML hub in your default browser
open NHous_TBOT_Project.html
designdna OSS /.claude/skills/designdna-*
First public OSS launch (May 7) — agent-native design.md convention. GitHub: Rrcher404/designdna.
# cd to local skill dirs (multiple locations)
cd ~/.claude/skills/ && ls -d designdna-*
# clone fresh + open
cd ~ && gh repo clone Rrcher404/designdna && cd designdna && code .
# quick alias for editing the live skills
alias dd="cd ~/.claude/skills && ls -d designdna-* && code ."
B2B AEC permit SaaS. Currently paused per 2026-05-11 update — restart when you signal it.
# revive when ready
cd ~/PermitPilot && source .venv/bin/activate && code . && pnpm dev
# alias
alias ef="cd ~/PermitPilot && source .venv/bin/activate && code ."# open live site
open https://entitleflow.com
Demo Chatbot demo-chatbot-sandy.vercel.app
Next.js chatbot demo. Phase B rebrand decision still pending — likely folding into NervaHous.
cd "~/Random CLaude/Random Projects and Thoughts/projects/demo-chatbot"
pnpm install
pnpm dev # http://localhost:3000# alias
alias demo='cd "~/Random CLaude/Random Projects and Thoughts/projects/demo-chatbot" && pnpm dev'
Services Landing services-landing-nine.vercel.app
Plain HTML landing. Phase B rebrand pending. Open it locally to tinker fast.
cd "~/Random CLaude/Random Projects and Thoughts/projects/services-landing"
open index.html
# or serve it on a port for live-reload testing
python3 -m http.server 4000
Jene's Hous Portfolio active build · 2026-05-11
Public front-door aggregator: designdna, EntitleFlow, NervaHous, Gumroad, Vercel demos, photography.
cd ~/JenesHous # adjust to actual folder name
pnpm install
pnpm dev
alias hous='cd ~/JenesHous && pnpm dev'
open -a "Obsidian" ~/Obsidian-Vaults/JeneX
# jump in via shell to grep across all notes
cd ~/Obsidian-Vaults/JeneX && rg "trading" --type md
alias vault='cd ~/Obsidian-Vaults/JeneX'
The "drop in everywhere" multi-launcher one function to rule them
A single shell function that swaps between your active projects. Replaces six aliases with one verb.
# paste into ~/.zshrc — then `source ~/.zshrc`work() {
case "$1" in
tbot) cd ~/Trading/NHous_TBOT && source .venv/bin/activate && code . ;;
dd) cd ~/.claude/skills && ls -d designdna-* && code . ;;
ef) cd ~/PermitPilot && source .venv/bin/activate && code . ;;
demo) cd "$HOME/Random CLaude/Random Projects and Thoughts/projects/demo-chatbot" && pnpm dev ;;
hous) cd ~/JenesHous && pnpm dev ;;
vault) cd ~/Obsidian-Vaults/JeneX ;;
rpt) cd "$HOME/Random CLaude/Random Projects and Thoughts" ;;
*) echo "usage: work tbot|dd|ef|demo|hous|vault|rpt" ;;
esac
}
Why this matters. ADHD-tax on context switching is real. The longer the gap between "I want to work on X" and "I'm coding on X", the more likely the spark dies. These aliases compress that gap from minutes to one second.
01Keyboard shortcuts
Two layers.Cmd = the app (Terminal.app or iTerm2) — tabs, splits, copy/paste. Ctrl = the shell (zsh) — line editing, history, signals. Ctrl works over SSH on a remote Linux box. Cmd does not.
Line navigation (shell layer — works everywhere)
Keys
What & why
Ctrl+A / Ctrl+E
Jump to start / end of line. Faster than holding arrows.
Ctrl+U
Kill from cursor to start of line. Clears half-typed commands instantly.
Ctrl+K
Kill from cursor to end of line.
Ctrl+W
Delete word backward. You'll use this most.
Ctrl+Y
Paste back what Ctrl+U/K/W just killed.
Option+← / Option+→
Word jump. Needs "Use Option as Meta" in Terminal prefs or "Left Option acts as Esc+" in iTerm2.
Ctrl+R
Reverse history search. Type, matches surface, Ctrl+R again to cycle older. Enter runs. Ctrl+G cancels.
Ctrl+L
Clear screen, keep scrollback. Works in SSH.
Ctrl+C
Interrupt current process (SIGINT).
Ctrl+D
EOF / exit shell when line is empty.
Ctrl+Z
Suspend process. Then bg resumes in background, fg brings back, jobs lists.
Terminal.app / iTerm2 app layer (Cmd shortcuts)
Keys
What
Cmd+K
Clear scrollback entirely. Different from Ctrl+L — Ctrl+L keeps history, Cmd+K nukes it.
Cmd+T / Cmd+W
New tab / close tab.
Cmd+D
iTerm2 Split vertically.
Cmd+Shift+D
iTerm2 Split horizontally.
Cmd+Option+arrows
iTerm2 Move focus between panes.
Cmd+1..9
Jump to tab N.
Cmd++ / Cmd+-
Font size up / down. Demo-day life saver.
Cmd+F
Find in scrollback.
Fn+Ctrl+←/→
Sequoia Window tiling — snap terminal to half-screen.
02Shell power moves
Command
Why
!!
Last command. Use after forgetting sudo.
sudo !!
Re-run last command with sudo. Daily driver.
!$
Last argument of last command. mkdir foo && cd !$
!*
All args of last command.
!python
Last command starting with "python".
^old^new
Re-run last command, swap first "old" for "new". Fix typos fast.
history | grep deploy
Find the command you ran two weeks ago.
cd -
Jump back to previous directory.
pushd /path / popd
Directory stack — go somewhere, come back.
Aliases that earn their keep
# add to ~/.zshrc, then `source ~/.zshrc`
alias ll="ls -lahG"
alias ..="cd .."
alias ...="cd ../.."
alias gs="git status -sb"
alias gd="git diff"
alias gds="git diff --staged"
alias gsw="git switch"
alias gl="git log --oneline --graph --all --decorate -20"
alias gpl="git pull --rebase --autostash"
alias serve="python3 -m http.server 8000"
alias myip="curl -s https://ifconfig.me; echo"
alias ports="lsof -iTCP -sTCP:LISTEN -nP"
alias reload="source ~/.zshrc"
After editing ~/.zshrc, run source ~/.zshrc (or your reload alias). New shells pick it up automatically.
03Files & directories
Command
Why
fd pattern
Modern find. Respects .gitignore. brew install fd.
fd -e py -x wc -l
Find all .py files, run wc -l on each.
rg "useState" --type ts
Ripgrep — orders of magnitude faster than grep. Daily default.
rg -l "import openai"
Just list filenames containing match.
tree -L 2 -I node_modules
Directory tree, 2 levels, skip node_modules.
eza --tree --git-ignore
Modern ls with tree mode. brew install eza.
bat file.py
cat with syntax highlighting + line numbers.
ls -lahS
List sorted by size, biggest first.
du -sh * | sort -h
Folder sizes, sorted small to large.
ncdu .
Interactive disk usage browser.
tail -f app.log
Watch a log file live.
less +F app.log
Like tail -f but you can Ctrl+C, scroll/search, then F to resume following.
One-liners that get used
# count lines of code, ignoring noise
fd -e ts -e tsx -e py -E node_modules -E .next -x wc -l | sort -n
# find and delete all .DS_Store recursively
fd -H -I -t f '\.DS_Store$' -x rm
# swap-in-place across many files (use git, preview without -i first)
rg -l "old_name" | xargs sed -i '''s/old_name/new_name/g'
macOS gotcha. BSD sed requires an empty string after -i (sed -i '' …). GNU sed on Linux doesn't. If a tutorial's sed -i fails — that's why.
04Processes & system
Command
Why
ps aux | grep node
Find every node process — useful when "port already in use" lies.
lsof -i :3000
What's holding port 3000? Returns PID.
kill -9 12345
SIGKILL — process cannot refuse.
killall node
Kill every process named "node".
pkill -f "next dev"
Kill by command-line pattern. Surgical.
top -o cpu
Built-in top, sorted by CPU. Press q to exit.
btop
Pretty process viewer — CPU/GPU/net/disk. brew install btop.
system_profiler SPHardwareDataType
Mac model, chip, RAM, serial. Skip the About-This-Mac click.
# "port 3000 in use" — find & kill in one move
lsof -ti:3000 | xargs kill -9
# every dev server you forgot you started
ps aux | grep -E "next|vite|uvicorn|gunicorn" | grep -v grep
05Git beyond basics
Command
Why
git log --oneline --graph --all --decorate
The one log command worth memorizing. Alias as gl.
git switch main
Modern replacement for git checkout on branches.
git switch -c feat/x
Create and switch.
git restore file.py
Discard unstaged changes. Replaces the scary old checkout --.
git restore --staged file.py
Unstage but keep edits.
git stash -u
Stash including untracked files. The -u people forget.
git reflog
Every HEAD move for 90 days. Recovers anything you think you lost.
git commit --amend
Edit the last commit. Don't amend after pushing to a shared branch.
git rebase -i HEAD~5
Squash, reword, drop, reorder the last 5.
git cherry-pick <sha>
Apply one commit from another branch.
git revert <sha>
Reverse a commit by making a new one. Safe on shared history.
git bisect start / good / bad
Binary-search for the commit that broke a thing.
Worktrees — parallel Claude Code sessions on one repo
# keep main checked out, spin up a sibling on a feature branch
git worktree add ../myrepo-feat-x feat/x
git worktree list
git worktree remove ../myrepo-feat-x
Why it matters for you specifically. Lets you run two Claude Code sessions side-by-side against the same repo (T-BOT main + T-BOT feature, for example) without branch-switching collisions. One .git, multiple working directories.
Safe undo cheats
# I want my last commit back but staged (didn't push yet)
git reset --soft HEAD~1
# I pushed a bad commit to main, can't rewrite
git revert <sha> && git push
# I think I lost a branch / commit
git reflog # find the sha
git switch -c rescue <sha>
06Homebrew & packages
Command
Why
brew install <pkg>
Install a CLI tool.
brew install --cask <app>
Install a GUI app.
brew update && brew upgrade
Refresh recipes, upgrade everything. Run weekly.
brew cleanup -s
Delete old versions + clear cache. Reclaims gigabytes.
brew leaves
Only top-level packages — the "what I asked for" list.
brew bundle dump --file=~/Brewfile
Snapshot your entire setup. Commit it.
brew bundle --file=~/Brewfile
Replay snapshot on a fresh Mac.
2026 install bundle worth keeping
# search / files
brew install ripgrep fd fzf bat eza tree jq yq dust
# shell UX
brew install zsh-autosuggestions zsh-syntax-highlighting starship atuin
# git & dev
brew install gh lazygit git-delta
# http & api
brew install httpie
# runtimes & package managers
brew install mise uv pnpm
# system
brew install btop ncdu tldr just
2026 note. Homebrew now audits all casks for proper Apple codesigning + notarization. Casks that fail are being removed from the official tap (deadline Sept 1, 2026). If a familiar cask vanishes — check the project's homepage for an official build.
07macOS-specific tricks
Command
Why
pbcopy / pbpaste
Read/write system clipboard. cat file | pbcopy is the bridge between terminal and everything else.
open .
Open current directory in Finder.
open -a "Visual Studio Code" .
Open with a specific app.
open -R file.txt
Reveal in Finder (don't open).
qlmanage -p file.png
QuickLook from terminal.
caffeinate -is npm run build
Prevent sleep until wrapped command exits.
say "build is done"
Audio notification when a long task finishes.
mdfind "kind:pdf invoice"
Spotlight from the CLI. Faster than the search bar.
screencapture out.png
Take a screenshot from the CLI.
softwareupdate -l
List available macOS updates.
# long task with audio + visual finish
caffeinate -is pnpm run build && say "build done" && osascript -e 'display notification "Build complete"'# pipe build output to clipboard so you can paste it to Claude
pnpm run build 2>&1 | pbcopy
08Python & Node runtimes
Python — uv is the 2026 default
# new project
uv init myproj && cd myproj
uv add fastapi uvicorn
uv run uvicorn main:app --reload
# existing project with requirements.txt
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
# still on plain pip? the classic venv pattern
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate
uv is ~10-100x faster than pip, handles venvs + Python versions, and replaces pip/pipx/virtualenv/poetry for most cases. Stop using conda unless you specifically need its scientific stack.
Node — pnpm wins on disk + speed
pnpm install
pnpm dev # whatever "dev" maps to in package.json
pnpm add zod
pnpm add -D vitest
# the npx equivalent
pnpm dlx create-next-app@latest my-app
mise — one tool, all runtime versions
# pin per-project versions in .mise.toml; auto-switches on cd
mise use node@22
mise use python@3.12
mise install
09Background & tmux
Command
Why
cmd &
Run in background, output still goes to current terminal.
cmd > out.log 2>&1 &
Background + capture all output.
nohup cmd &
Survives terminal close. Output to nohup.out.
disown
Detach the current job from the shell.
jobs / fg %1
List background jobs / bring job 1 to foreground.
tmux — outlive the terminal
tmux new -s work # start a named session# inside: detach with Ctrl+bd
tmux ls # list sessions
tmux attach -t work # reattach
tmux kill-session -t work
tmux navigation (inside session)
Keys
What
Ctrl+bc
New window
Ctrl+b" / %
Split horizontal / vertical
Ctrl+barrows
Move between panes
Ctrl+bd
Detach (session keeps running)
When to use what.& for quick babysat task. nohup & for fire-and-forget. tmux when you want a second-shell setup that survives SSH drops, sleeps, terminal crashes — or to keep a training/build running over lunch.
# generate a modern key
ssh-keygen -t ed25519 -C "jyecem@gmail.com"# add to ssh-agent (macOS keychain integration)
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
# copy public key to clipboard
pbcopy < ~/.ssh/id_ed25519.pub
~/.ssh/config — host aliases
Host github.com
IdentityFile ~/.ssh/id_ed25519
AddKeysToAgent yes
UseKeychain yes
Host vps
HostName 203.0.113.10
User jene
IdentityFile ~/.ssh/id_ed25519_vps
Port 22
# now `ssh vps` instead of the full string
Context. An orphan ~/.git at home once ate 551 GB on this machine. Pack files in stray repos are the most common hidden bloat. Always inspect before deleting.
Find the worst offenders
# sizes of every top-level entry in home, sorted
du -sh ~/* ~/.[!.]* 2>/dev/null | sort -h
# the suspect: orphan git pack at home
du -sh ~/.git 2>/dev/null
du -sh ~/.git/objects/pack/ 2>/dev/null
# biggest dirs anywhere under home, top 20
du -h -d 3 ~ 2>/dev/null | sort -h | tail -20
# interactive deep-dive — best single tool
ncdu ~
# biggest *files* over 500 MB
fd -t f -S +500m . ~ 2>/dev/null
# free space + breakdown
df -h /
Common offenders worth checking
du -sh ~/Library/Developer/Xcode/DerivedData # Xcode builds, safe to wipe
du -sh ~/Library/Caches # browser/app caches
du -sh ~/Library/Containers/com.docker.docker # Docker.raw — huge
du -sh ~/.npm ~/.pnpm-store ~/.cache/uv ~/.cache/pip
du -sh ~/Library/Application\ Support/Claude # session/cache# every node_modules across disk + total
fd -H -t d '^node_modules$' ~ -x du -sh {} \; 2>/dev/null | sort -h
Safe cleanup patterns
# homebrew cruft
brew cleanup -s
brew autoremove
# package-manager caches (safe — redownload on demand)
pnpm store prune
npm cache clean --force
uv cache clean
# Xcode DerivedData — safe, rebuilds
rm -rf ~/Library/Developer/Xcode/DerivedData/*
# Docker — reclaim space from daemon
docker system prune -a --volumes
# prune one stray git repo (DON'T just rm -rf .git on a real project)
cd suspect-repo
git gc --aggressive --prune=now
Rules of the road. Never rm -rf something whose size shocked you until you've identified what it is. ls -la first, ncdu second, rm last. If a .git at home (not inside a project) is gigabytes — that's a stray repo. Confirm there are no commits worth keeping (cd ~ && git log) before removing.