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.
Navigation Within a Line
| Action | macOS | Windows/Linux |
|---|---|---|
| Move cursor left one character | ← | ← |
| Move cursor right one character | → | → |
| Move left one word | Option + ← | Ctrl + ← |
| Move right one word | Option + → | Ctrl + → |
| Jump to beginning of line | Ctrl + A | Ctrl + A or Home |
| Jump to end of line | Ctrl + E | Ctrl + E or End |
Editing
| Action | macOS | Windows/Linux |
|---|---|---|
| Delete character before cursor | Backspace | Backspace |
| Delete character after cursor | Ctrl + D | Ctrl + D or Delete |
| Delete word before cursor | Ctrl + W | Ctrl + W |
| Delete from cursor to end of line | Ctrl + K | Ctrl + K |
| Delete from cursor to start of line | Ctrl + U | Ctrl + U |
| Undo (yank back deleted text) | Ctrl + Y | Ctrl + Y |
| Clear the screen | Ctrl + L | Ctrl + L |
| Cancel current command | Ctrl + C | Ctrl + C |
Selection (with Shift)
Adding Shift to movement commands selects text:
| Action | macOS | Windows/Linux |
|---|---|---|
| Select character left | Shift + ← | Shift + ← |
| Select character right | Shift + → | Shift + → |
| Select word left | Shift + Option + ← | Shift + Ctrl + ← |
| Select word right | Shift + Option + → | Shift + Ctrl + → |
| Select to beginning of line | Shift + Ctrl + A | Shift + Home |
| Select to end of line | Shift + Ctrl + E | Shift + End |
Command History
| Action | macOS/Linux | Windows |
|---|---|---|
| Previous command | ↑ | ↑ |
| Next command | ↓ | ↓ |
| Search command history | Ctrl + R | Ctrl + R |
| Run previous command | !! | N/A (Bash only) |
| Run previous command with sudo | sudo !! | N/A (Bash only) See Elevated Privileges for details on sudo risks and alternatives. |
Using Ctrl + R (Reverse Search)
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 + Rto cycle through matches - Press
Enterto run the command - Press
→to edit the command before running - Press
Ctrl + Cto 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
- Type a long command (don't press Enter):
echo "This is a really long command that I am typing to practice keyboard shortcuts" - Jump to the beginning of the line
- Jump to the end of the line
- Move back one word at a time to reach "keyboard"
- Delete from cursor to end of line
- Cancel and clear (
Ctrl + C)
What You Should Feel
Ctrl + Ato jump to the start — instant, no arrow key mashingCtrl + Eto jump to the end — instantOption + ←(Mac) orCtrl + ←(Windows) — jumping word by word feels powerfulCtrl + Kto delete to end — much faster than holding backspace- These shortcuts become second nature with practice
Exercise: Use Command History
- Run these commands:
echo "first"
echo "second"
echo "third" - Press
↑to cycle through your history - Use
Ctrl + Rand type "sec" to find the second command - Press
Enterto run it again
What You Should Notice
- Arrow keys cycle through recent commands
Ctrl + Rlets 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:
- Keep defaults for now — focus on learning the basics first
- Try Starship when you're ready — it's the easiest to set up and works everywhere
- 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 │
└────────────────────────┴────────────────────────┘
Zellij (Recommended for Beginners)
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?
| Tool | Best For |
|---|---|
| Zellij | Beginners, those who want it to "just work" |
| tmux | Power users, remote server work, maximum compatibility |
| screen | Legacy 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:
| Terminal | Platform | Notable Features |
|---|---|---|
| iTerm2 | macOS | Split panes, search, profiles, tmux integration |
| Windows Terminal | Windows | Tabs, GPU rendering, profiles, modern |
| Alacritty | Cross-platform | GPU-accelerated, minimal, fast (Rust) |
| Warp | macOS, Linux | AI features, modern UI, blocks-based output |
| Kitty | Cross-platform | GPU-based, images in terminal, extensible |
| WezTerm | Cross-platform | GPU-accelerated, multiplexer built-in (Rust) |
These are purely optional upgrades. The built-in terminal on your system works fine.
When to Explore This
- Not now — if you're new to the terminal, focus on the basics first
- After a few weeks — once commands feel natural, try Starship for a nicer prompt
- When you need it — multiplexers become valuable when you're running multiple processes or working on remote servers
- 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
- Starship Documentation — Configuration reference
- Oh My Zsh Wiki — Plugins and themes
- Fish Shell Tutorial — Getting started with Fish
Terminal Multiplexing
- Zellij User Guide — Official docs
- tmux Cheat Sheet — Quick reference
- The Tao of tmux — Free online book
Videos
- Fireship: Customize Your Terminal — Quick overview
- ThePrimeagen: tmux in 100 seconds — tmux basics
- DevOps Toolbox: Zellij vs tmux — Comparison