Skip to main content

Extracurricular: Terminal Going Further

Keyboard shortcuts, shell customization, terminal multiplexing, and modern tools


Why This Page Exists

The main Terminal Basics module teaches the essential skills you need to use the command line. This page covers productivity enhancements and customization for those who want to:

  • Work faster with keyboard shortcuts
  • Customize their shell prompt and experience
  • Use terminal multiplexers for managing multiple sessions
  • Explore modern terminal emulators

None of this is required to continue with the curriculum. But these skills will make you noticeably faster and more comfortable in the terminal.


Power User Keyboard Shortcuts

These shortcuts will make you significantly faster. Practice them until they're muscle memory.

ActionmacOSWindows/Linux
Move cursor left one character
Move cursor right one character
Move left one wordOption + ←Ctrl + ←
Move right one wordOption + →Ctrl + →
Jump to beginning of lineCtrl + ACtrl + A or Home
Jump to end of lineCtrl + ECtrl + E or End

Editing

ActionmacOSWindows/Linux
Delete character before cursorBackspaceBackspace
Delete character after cursorCtrl + DCtrl + D or Delete
Delete word before cursorCtrl + WCtrl + W
Delete from cursor to end of lineCtrl + KCtrl + K
Delete from cursor to start of lineCtrl + UCtrl + U
Undo (yank back deleted text)Ctrl + YCtrl + Y
Clear the screenCtrl + LCtrl + L
Cancel current commandCtrl + CCtrl + C

Selection (with Shift)

Adding Shift to movement commands selects text:

ActionmacOSWindows/Linux
Select character leftShift + ←Shift + ←
Select character rightShift + →Shift + →
Select word leftShift + Option + ←Shift + Ctrl + ←
Select word rightShift + Option + →Shift + Ctrl + →
Select to beginning of lineShift + Ctrl + AShift + Home
Select to end of lineShift + Ctrl + EShift + End

Command History

ActionmacOS/LinuxWindows
Previous command
Next command
Search command historyCtrl + RCtrl + R
Run previous command!!N/A (Bash only)
Run previous command with sudosudo !!N/A (Bash only)
See Elevated Privileges for details on sudo risks and alternatives.

This is incredibly powerful. Press Ctrl + R and start typing part of a previous command:

(reverse-i-search)`npm': npm run build
  • Keep pressing Ctrl + R to cycle through matches
  • Press Enter to run the command
  • Press to edit the command before running
  • Press Ctrl + C to cancel

Tab Completion

Press Tab to autocomplete:

cd Doc[Tab]
# Completes to: cd Documents/

Press Tab twice to see all possibilities:

cd D[Tab][Tab]
# Shows: Desktop/ Documents/ Downloads/

Tab completion works for:

  • File and folder names
  • Command names
  • Git branches
  • And more (depending on your shell configuration)

Exercises

Exercise: Practice Keyboard Shortcuts

  1. Type a long command (don't press Enter): echo "This is a really long command that I am typing to practice keyboard shortcuts"
  2. Jump to the beginning of the line
  3. Jump to the end of the line
  4. Move back one word at a time to reach "keyboard"
  5. Delete from cursor to end of line
  6. Cancel and clear (Ctrl + C)
What You Should Feel
  • Ctrl + A to jump to the start — instant, no arrow key mashing
  • Ctrl + E to jump to the end — instant
  • Option + ← (Mac) or Ctrl + ← (Windows) — jumping word by word feels powerful
  • Ctrl + K to delete to end — much faster than holding backspace
  • These shortcuts become second nature with practice

Exercise: Use Command History

  1. Run these commands:
    echo "first"
    echo "second"
    echo "third"
  2. Press to cycle through your history
  3. Use Ctrl + R and type "sec" to find the second command
  4. Press Enter to run it again
What You Should Notice
  • Arrow keys cycle through recent commands
  • Ctrl + R lets you search by typing any part of a previous command
  • This saves huge amounts of time when you need to re-run complex commands

Shell Customization

Remember how we mentioned different shells (Bash, Zsh, Fish)? Each can be customized extensively.

Alternative Shells

Fish (Friendly Interactive Shell)

  • User-friendly out of the box — syntax highlighting, autosuggestions, tab completions
  • Different syntax than Bash (scripts aren't compatible)
  • Great for interactive use; many developers use Fish daily but write scripts in Bash
  • fishshell.com

Zsh (Z Shell)

  • Bash-compatible but with more features
  • Default on macOS since Catalina
  • Highly customizable with frameworks and plugins
  • Most popular choice for customization

Prompt Customization

Your prompt is the text that appears before your cursor (like username@computer ~ $). You can make it show useful information: current directory, git branch, programming language versions, and more.

Starship (Recommended)

  • Works with any shell (Bash, Zsh, Fish, PowerShell)
  • Fast (written in Rust), minimal, highly customizable
  • Single binary, simple TOML config file
  • Shows context-aware info (git status, Node version, Python env, etc.)
  • starship.rs
# Install on macOS
brew install starship

# Add to your shell config (~/.zshrc or ~/.bashrc)
eval "$(starship init zsh)"

Powerlevel10k (Zsh only)

  • Extremely fast with "instant prompt" feature
  • Rich configuration wizard
  • Note: The maintainer has reduced active development, but it still works well
  • github.com/romkatv/powerlevel10k

Oh My Zsh

  • Framework for managing Zsh configuration
  • Hundreds of plugins and themes
  • Easy to get started, but can slow down your shell if you add too many plugins
  • ohmyz.sh

What to Choose?

If you're just starting out:

  1. Keep defaults for now — focus on learning the basics first
  2. Try Starship when you're ready — it's the easiest to set up and works everywhere
  3. Explore Oh My Zsh if you want plugins (git shortcuts, autocompletions, etc.)

Terminal Multiplexing

A terminal multiplexer lets you:

  • Split your terminal into multiple panes
  • Create multiple "windows" (tabs) within one terminal
  • Detach and reattach sessions — start a process, disconnect, reconnect later and it's still running
  • Essential for remote server work (SSH sessions survive disconnection)
┌─────────────────────────────────────────────────┐
│ ~/project $ npm run dev │
│ Server running on localhost:3000 │
├────────────────────────┬────────────────────────┤
│ ~/project $ git status │ ~/project $ npm test │
│ On branch main │ PASS tests/app.test.js│
│ nothing to commit │ 3 tests passed │
└────────────────────────┴────────────────────────┘

Modern terminal multiplexer written in Rust. The key advantage: it shows you the keybindings at the bottom of the screen.

  • Zero configuration needed — works great out of the box
  • Discoverable UI — no memorization required
  • Session management built-in (auto-saves, easy to resume)
  • Plugin system (WebAssembly-based)
  • zellij.dev
# Install on macOS
brew install zellij

# Start it
zellij

Press Ctrl + p then d to detach. Run zellij attach to reconnect.

tmux (The Standard)

The established choice, used everywhere, extensive ecosystem.

  • Available on virtually every Linux/Unix system
  • Highly scriptable and configurable
  • Steep learning curve (keybindings aren't shown)
  • Massive community, plugins, and resources
  • github.com/tmux/tmux
# Install on macOS
brew install tmux

# Start it
tmux

# Split horizontally: Ctrl+b then "
# Split vertically: Ctrl+b then %
# Detach: Ctrl+b then d
# Reattach: tmux attach

screen (Legacy)

The original terminal multiplexer. Still works, still installed on many servers, but tmux and Zellij have largely superseded it. You might encounter it on older systems. See the GNU Screen manual.

What to Choose?

ToolBest For
ZellijBeginners, those who want it to "just work"
tmuxPower users, remote server work, maximum compatibility
screenLegacy systems where nothing else is available

Recommendation: Start with Zellij to learn the concepts, then try tmux if you need its ecosystem or work on remote servers frequently.


Modern Terminal Emulators

The terminal app itself can be upgraded:

TerminalPlatformNotable Features
iTerm2macOSSplit panes, search, profiles, tmux integration
Windows TerminalWindowsTabs, GPU rendering, profiles, modern
AlacrittyCross-platformGPU-accelerated, minimal, fast (Rust)
WarpmacOS, LinuxAI features, modern UI, blocks-based output
KittyCross-platformGPU-based, images in terminal, extensible
WezTermCross-platformGPU-accelerated, multiplexer built-in (Rust)

These are purely optional upgrades. The built-in terminal on your system works fine.


When to Explore This

  1. Not now — if you're new to the terminal, focus on the basics first
  2. After a few weeks — once commands feel natural, try Starship for a nicer prompt
  3. When you need it — multiplexers become valuable when you're running multiple processes or working on remote servers
  4. When you're curious — there's no wrong time to experiment!

The terminal is endlessly customizable. That's part of what makes it powerful — and why developers often have strong opinions about their setups. Start simple, add tools when you feel the need.


Further Reading

Shell Customization

Terminal Multiplexing

Videos


👈 Back to Terminal Basics