Choose your dojo

Master every interface, one skill at a time

trackpadninja.com

Terminal Dojo Cheat Sheet

Quick reference — print and keep nearby

Terminal Dojo

Terminal Quiz Command recall

Check your muscle memory for shell skills.

Terminal Practice Calm reps

Practice navigation, search, and safe command patterns.

Workspace & Window Control

Tabbed Terminals Parallel tasks

One window, multiple contexts.

  1. Press Command + T to create a new tab
  2. Press Command + Shift + [ or Command + Shift + ] to switch between tabs
  3. Press Command + W to close the current tab
Split Panes Watch and work

Watch and work side-by-side.

  1. Press Command + D to split the window vertically
  2. Click in either pane to focus it
  3. Press Command + Shift + D to close the split pane
Restore Windows After restart

Pick up where you left off.

  1. Open System Settings and go to Desktop & Dock
  2. Turn off "Close windows when quitting an application"
  3. In Terminal, go to Settings > Profiles > Window
  4. Check "Restore text when reopening windows"
Name Tabs Reduce overhead

Reduce mental overhead instantly.

  1. Right-click on the tab title bar
  2. Select "Edit Title"
  3. Type your custom name and press Enter

Speed & Recall

Reverse Search Ctrl+R

Don't retype — recall.

  1. Press Control + R to start reverse search
  2. Type part of the command you want to find
  3. Press Control + R again to find the next match
  4. Press Enter to run the command, or press Escape to cancel
Repeat Last Command !!

Fix small mistakes fast.

  1. Type !! and press Enter to run the last command
  2. You can also press the Up arrow to recall the last command, then edit it before running
Reuse Last Argument !$

Chain work without retyping paths.

  1. Type your new command, then type !$ where you want the last argument
  2. Press Tab to expand it, or just press Enter and it will expand automatically
  3. For example: cd /some/long/path then ls !$ becomes ls /some/long/path

Clipboard Power

Copy to Clipboard pbcopy

Terminal to Notes to Email in one step.

  1. Pipe any command's output to pbcopy
  2. For example: pwd | pbcopy copies your current directory path
  3. Or: ls | pbcopy copies the file listing
  4. Then paste with Command + V in any app
Paste from Clipboard pbpaste

Turn copied text into data.

  1. Copy some text to your clipboard (like a file path from Finder)
  2. Use pbpaste in your command
  3. For example: cd $(pbpaste) changes to the directory you copied
  4. Or: cat $(pbpaste) displays the file whose path you copied
Capture Output No files

Use the clipboard instead of temp files.

  1. Pipe command output to pbcopy
  2. For example: grep -r "search term" . | pbcopy
  3. The results go to your clipboard, ready to paste anywhere
  4. No files created, no cleanup needed

Navigation & Files

Jump Back cd -

Instant context switching.

  1. Type cd - and press Enter
  2. You'll jump back to your previous directory
  3. Run it again to toggle between the two directories
Open in Finder open .

Bridge Terminal and GUI instantly.

  1. Type open . to open the current directory
  2. Or type open /path/to/directory to open any directory
  3. A Finder window opens showing that location
Drag and Drop Paths Zero typing

Zero typing, zero mistakes.

  1. Start typing a command that needs a file path
  2. Drag a file or folder from Finder into the terminal window
  3. The full path appears at your cursor position
  4. Press Enter to run the command

Customization

Simple Aliases Short names

Turn friction into muscle memory.

  1. Type alias shortname='long command here'
  2. For example: alias ll='ls -la'
  3. Now typing ll runs ls -la
  4. Type alias to see all your aliases
Persistent Aliases Save forever

Teach your terminal once.

  1. Open your shell configuration file: nano ~/.zshrc (or ~/.bash_profile for bash)
  2. Add your alias on a new line: alias ll='ls -la'
  3. Save and exit (in nano: Control + X, then Y, then Enter)
  4. Run source ~/.zshrc to load the changes, or open a new terminal window
Color-Code Terminals Visual safety

Visual safety for important work.

  1. Go to Terminal > Settings > Profiles
  2. Select a profile or duplicate an existing one
  3. Click the "Window" tab
  4. Under "Background", choose a color
  5. Name the profile (e.g., "Production - Red")
  6. Use Shell > New Window to open terminals with different profiles

Pipelines

Filter with grep Find what matters

Find what matters, ignore the rest.

  1. Pipe command output to grep followed by your search term
  2. For example: ls -la | grep Documents shows only files with "Documents" in the name
  3. Or: ps aux | grep python shows only processes containing "python"
Count with wc Turn output into insight

Turn output into insight.

  1. Use wc -l to count lines
  2. For example: ls | wc -l counts files in the current directory
  3. Or: grep "pattern" file.txt | wc -l counts matching lines
  4. Use wc -w for words, wc -c for characters
Sort and Clean Make lists usable

Make messy lists usable.

  1. Pipe output to sort to alphabetize: ls | sort
  2. Use sort -u to sort and remove duplicates
  3. Or use uniq to remove duplicate lines: command | uniq
  4. Combine them: ls | sort | uniq

Automation

Reusable Script Automate it

If you've done it twice, automate it.

  1. Create a file: nano myscript.sh
  2. Add #!/bin/bash as the first line
  3. Add your commands on separate lines
  4. Save and exit (in nano: Control + X, Y, Enter)
  5. Make it executable: chmod +x myscript.sh
  6. Run it: ./myscript.sh