Terminal Dojo Cheat Sheet
Quick reference — print and keep nearby
Terminal Dojo
Check your muscle memory for shell skills.
Practice navigation, search, and safe command patterns.
Workspace & Window Control
One window, multiple contexts.
- Press Command + T to create a new tab
- Press Command + Shift + [ or Command + Shift + ] to switch between tabs
- Press Command + W to close the current tab
Watch and work side-by-side.
- Press Command + D to split the window vertically
- Click in either pane to focus it
- Press Command + Shift + D to close the split pane
Pick up where you left off.
- Open System Settings and go to Desktop & Dock
- Turn off "Close windows when quitting an application"
- In Terminal, go to Settings > Profiles > Window
- Check "Restore text when reopening windows"
Reduce mental overhead instantly.
- Right-click on the tab title bar
- Select "Edit Title"
- Type your custom name and press Enter
Speed & Recall
Don't retype — recall.
- Press Control + R to start reverse search
- Type part of the command you want to find
- Press Control + R again to find the next match
- Press Enter to run the command, or press Escape to cancel
Fix small mistakes fast.
- Type
!!and press Enter to run the last command - You can also press the Up arrow to recall the last command, then edit it before running
Chain work without retyping paths.
- Type your new command, then type
!$where you want the last argument - Press Tab to expand it, or just press Enter and it will expand automatically
- For example:
cd /some/long/paththenls !$becomesls /some/long/path
Clipboard Power
Terminal to Notes to Email in one step.
- Pipe any command's output to
pbcopy - For example:
pwd | pbcopycopies your current directory path - Or:
ls | pbcopycopies the file listing - Then paste with Command + V in any app
Turn copied text into data.
- Copy some text to your clipboard (like a file path from Finder)
- Use
pbpastein your command - For example:
cd $(pbpaste)changes to the directory you copied - Or:
cat $(pbpaste)displays the file whose path you copied
Use the clipboard instead of temp files.
- Pipe command output to
pbcopy - For example:
grep -r "search term" . | pbcopy - The results go to your clipboard, ready to paste anywhere
- No files created, no cleanup needed
Navigation & Files
Instant context switching.
- Type
cd -and press Enter - You'll jump back to your previous directory
- Run it again to toggle between the two directories
Bridge Terminal and GUI instantly.
- Type
open .to open the current directory - Or type
open /path/to/directoryto open any directory - A Finder window opens showing that location
Zero typing, zero mistakes.
- Start typing a command that needs a file path
- Drag a file or folder from Finder into the terminal window
- The full path appears at your cursor position
- Press Enter to run the command
Customization
Turn friction into muscle memory.
- Type
alias shortname='long command here' - For example:
alias ll='ls -la' - Now typing
llrunsls -la - Type
aliasto see all your aliases
Teach your terminal once.
- Open your shell configuration file:
nano ~/.zshrc(or~/.bash_profilefor bash) - Add your alias on a new line:
alias ll='ls -la' - Save and exit (in nano: Control + X, then Y, then Enter)
- Run
source ~/.zshrcto load the changes, or open a new terminal window
Visual safety for important work.
- Go to Terminal > Settings > Profiles
- Select a profile or duplicate an existing one
- Click the "Window" tab
- Under "Background", choose a color
- Name the profile (e.g., "Production - Red")
- Use Shell > New Window to open terminals with different profiles
Pipelines
Find what matters, ignore the rest.
- Pipe command output to
grepfollowed by your search term - For example:
ls -la | grep Documentsshows only files with "Documents" in the name - Or:
ps aux | grep pythonshows only processes containing "python"
Turn output into insight.
- Use
wc -lto count lines - For example:
ls | wc -lcounts files in the current directory - Or:
grep "pattern" file.txt | wc -lcounts matching lines - Use
wc -wfor words,wc -cfor characters
Make messy lists usable.
- Pipe output to
sortto alphabetize:ls | sort - Use
sort -uto sort and remove duplicates - Or use
uniqto remove duplicate lines:command | uniq - Combine them:
ls | sort | uniq
Automation
If you've done it twice, automate it.
- Create a file:
nano myscript.sh - Add
#!/bin/bashas the first line - Add your commands on separate lines
- Save and exit (in nano: Control + X, Y, Enter)
- Make it executable:
chmod +x myscript.sh - Run it:
./myscript.sh