NERVAHOUSFIELD GUIDE01 / 03

The Terminal
Cheat Sheet

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?

CommandWhat it does — try it first
pwdPrint working directory. Tells you where you currently are. The "you are here" pin.
lsList files in the current folder.
ls -laList everything — including hidden files (the ones starting with a dot). Plus sizes, dates, permissions.
ls -lahSame as above but human-readable sizes (KB, MB instead of bytes). Daily driver.
tree -L 2See the folder structure 2 levels deep. brew install tree if you don't have it.
clearWipe the screen so you can think again. Or just hit Cmd+K.

Move around folders

CommandWhat 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 DesktopGo into a folder by name (from where you are right now).
cd ~/DownloadsGo 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

CommandGoes to
cd ~Home (/Users/jyecemaybury)
cd "~/Random CLaude/Random Projects and Thoughts"This workshop folder. Quotes needed because of the space.
cd ~/NervaHousNervaHous brand + content
cd ~/studiohousStudio Hous (creative arm)
cd ~/Trading/NHous_TBOTThe trading bot
cd ~/PermitPilotEntitleFlow / PermitPilot
cd ~/.claude/skillsLocal Claude skills (designdna lives here)
cd ~/Obsidian-Vaults/JeneXThe JeneX vault
cd ~/"Mission Control-JeneX"Mission Control

Open things from the terminal

CommandWhat it does
open .Open the current folder in Finder. The dot means "here". You'll use this constantly.
open ~/DownloadsOpen any specific folder in Finder.
open file.pdfOpen 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.txtShow a file in Finder without opening it (reveal).
open https://github.comOpen a URL in your default browser.

Make, move, delete

CommandWhat it does
mkdir newfolderCreate a new folder.
mkdir -p a/b/cCreate a nested chain in one go. The -p means "make parents too, don't error if they exist."
touch file.txtCreate an empty file. Or update an existing one's timestamp.
cp original.txt copy.txtCopy a file.
cp -r folder copy-of-folderCopy a folder (the -r = recursive, copies contents too).
mv oldname.txt newname.txtRename a file. Same command moves: mv file.txt ~/Desktop/.
rm file.txtDelete a file. No trash — gone immediately.
rm -r folderDelete 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

CommandWhat it does
cat file.txtDump the whole file to the screen.
less file.txtOpen a file for scrolling. Space = next page, q = quit, /word = search.
head file.txtFirst 10 lines.
head -n 30 file.txtFirst 30 lines.
tail file.txtLast 10 lines.
wc -l file.txtCount lines in a file.

Getting unstuck mid-command

KeysWhat it does
Ctrl+CThe universal "stop this". Kills whatever's currently running. Use it the moment something feels wrong.
Ctrl+L or clearClear the screen, keep scrollback.
Cmd+KWipe scrollback entirely (Terminal app shortcut).
arrowPrevious command. Keep pressing to walk back through history.
exit or Ctrl+DClose 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 ."

EntitleFlow / PermitPilot /PermitPilot · entitleflow.com

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'

JeneX Obsidian Vault /Obsidian-Vaults/JeneX

Your knowledge base. 7 scheduled crew agents (Ferryman, Navigator, Archivist, Watchkeeper, Editor, Cartographer, Auditor).

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)

KeysWhat & why
Ctrl+A / Ctrl+EJump to start / end of line. Faster than holding arrows.
Ctrl+UKill from cursor to start of line. Clears half-typed commands instantly.
Ctrl+KKill from cursor to end of line.
Ctrl+WDelete word backward. You'll use this most.
Ctrl+YPaste 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+RReverse history search. Type, matches surface, Ctrl+R again to cycle older. Enter runs. Ctrl+G cancels.
Ctrl+LClear screen, keep scrollback. Works in SSH.
Ctrl+CInterrupt current process (SIGINT).
Ctrl+DEOF / exit shell when line is empty.
Ctrl+ZSuspend process. Then bg resumes in background, fg brings back, jobs lists.

Terminal.app / iTerm2 app layer (Cmd shortcuts)

KeysWhat
Cmd+KClear scrollback entirely. Different from Ctrl+L — Ctrl+L keeps history, Cmd+K nukes it.
Cmd+T / Cmd+WNew tab / close tab.
Cmd+DiTerm2 Split vertically.
Cmd+Shift+DiTerm2 Split horizontally.
Cmd+Option+arrowsiTerm2 Move focus between panes.
Cmd+1..9Jump to tab N.
Cmd++ / Cmd+-Font size up / down. Demo-day life saver.
Cmd+FFind in scrollback.
Fn+Ctrl+/Sequoia Window tiling — snap terminal to half-screen.

02Shell power moves

CommandWhy
!!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.
!pythonLast command starting with "python".
^old^newRe-run last command, swap first "old" for "new". Fix typos fast.
history | grep deployFind the command you ran two weeks ago.
cd -Jump back to previous directory.
pushd /path / popdDirectory 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

CommandWhy
fd patternModern find. Respects .gitignore. brew install fd.
fd -e py -x wc -lFind all .py files, run wc -l on each.
rg "useState" --type tsRipgrep — orders of magnitude faster than grep. Daily default.
rg -l "import openai"Just list filenames containing match.
tree -L 2 -I node_modulesDirectory tree, 2 levels, skip node_modules.
eza --tree --git-ignoreModern ls with tree mode. brew install eza.
bat file.pycat with syntax highlighting + line numbers.
ls -lahSList sorted by size, biggest first.
du -sh * | sort -hFolder sizes, sorted small to large.
ncdu .Interactive disk usage browser.
tail -f app.logWatch a log file live.
less +F app.logLike 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

CommandWhy
ps aux | grep nodeFind every node process — useful when "port already in use" lies.
lsof -i :3000What's holding port 3000? Returns PID.
kill -9 12345SIGKILL — process cannot refuse.
killall nodeKill every process named "node".
pkill -f "next dev"Kill by command-line pattern. Surgical.
top -o cpuBuilt-in top, sorted by CPU. Press q to exit.
btopPretty process viewer — CPU/GPU/net/disk. brew install btop.
system_profiler SPHardwareDataTypeMac 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

CommandWhy
git log --oneline --graph --all --decorateThe one log command worth memorizing. Alias as gl.
git switch mainModern replacement for git checkout on branches.
git switch -c feat/xCreate and switch.
git restore file.pyDiscard unstaged changes. Replaces the scary old checkout --.
git restore --staged file.pyUnstage but keep edits.
git stash -uStash including untracked files. The -u people forget.
git reflogEvery HEAD move for 90 days. Recovers anything you think you lost.
git commit --amendEdit the last commit. Don't amend after pushing to a shared branch.
git rebase -i HEAD~5Squash, 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 / badBinary-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

CommandWhy
brew install <pkg>Install a CLI tool.
brew install --cask <app>Install a GUI app.
brew update && brew upgradeRefresh recipes, upgrade everything. Run weekly.
brew cleanup -sDelete old versions + clear cache. Reclaims gigabytes.
brew leavesOnly top-level packages — the "what I asked for" list.
brew bundle dump --file=~/BrewfileSnapshot your entire setup. Commit it.
brew bundle --file=~/BrewfileReplay 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

CommandWhy
pbcopy / pbpasteRead/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.txtReveal in Finder (don't open).
qlmanage -p file.pngQuickLook from terminal.
caffeinate -is npm run buildPrevent 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.pngTake a screenshot from the CLI.
softwareupdate -lList 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

CommandWhy
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.
disownDetach the current job from the shell.
jobs / fg %1List background jobs / bring job 1 to foreground.

tmux — outlive the terminal

tmux new -s work            # start a named session
# inside: detach with Ctrl+b d
tmux ls                     # list sessions
tmux attach -t work         # reattach
tmux kill-session -t work

tmux navigation (inside session)

KeysWhat
Ctrl+b cNew window
Ctrl+b " / %Split horizontal / vertical
Ctrl+b arrowsMove between panes
Ctrl+b dDetach (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.

10Environment & zshrc

CommandWhy
echo $PATH | tr ":" "\n"PATH, one per line, readable.
which python3Which binary runs when you type this.
type python3More info — also reveals aliases & functions.
where nodezsh Every node on PATH (catches duplicates).
export FOO=barSet for this shell + children.
FOO=bar cmdSet for just one command (no leak).
source ~/.zshrcReload zsh config without restart.

~/.zshrc skeleton worth stealing

# Homebrew (Apple Silicon path)
eval "$(/opt/homebrew/bin/brew shellenv)"

# mise — auto-switch runtime versions per project
eval "$(mise activate zsh)"

# oh-my-zsh (if used)
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git macos zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh

# fzf — fuzzy everything
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# atuin — searchable shell history
eval "$(atuin init zsh)"

# aliases
[ -f ~/.aliases ] && source ~/.aliases

# editor + extra path
export EDITOR="code -w"
export PATH="$HOME/.local/bin:$PATH"

11SSH & GitHub

SSH keys

# 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

GitHub CLI — daily essentials

gh auth login                          # browser-based auth, no token paste
gh repo create myproj --private --source=. --push
gh repo clone owner/repo
gh pr create --fill                    # PR title/body from commits
gh pr view --web
gh pr checkout 42                      # local checkout of PR #42
gh pr merge --squash --delete-branch
gh issue list --assignee @me
gh release create v1.0 --notes "..."

12Mac storage emergency

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.