You have learned the commands. You know how to navigate, manipulate files, and search. But knowing the commands is not what makes experienced developers fast. It is the habits, shortcuts, and workflows that turn the terminalWhat is terminal?A text-based interface where you type commands to interact with your computer. Also called the command line or shell. from a tool into an extension of your thoughts.
This lesson is not about new commands. It is about using the terminal efficiently. The difference between a beginner and a pro is not memorizing obscure flags, it is mastering the fundamentals that save seconds on every interaction. Those seconds add up to hours over a week.
Command history: never retype
Here is the single most important productivity tip: you almost never need to type a command twice.
The up arrow
Press the Up arrow key. It brings back your previous command. Press it again, there is the command before that. Keep pressing to go back through everything you have typed in this sessionWhat is session?A server-side record that tracks a logged-in user. The browser holds only a session ID in a cookie, and the server looks up the full data on each request..
echo "hello world" # Type this
# Press Up - it reappears, ready to edit
echo "hello universe" # Modify and press EnterSearching history with Ctrl+R
The Up arrow is great for recent commands. But what about that command you ran three days ago? Press Ctrl+R to start a reverse search:
(reverse-i-search)`git': git commit -m "fix login bug"Type part of the command you remember. Press Ctrl+R again to cycle through matches. When you find the right one, press Enter to run it or Right arrow to edit it first.
Viewing your full history
history # Show numbered list of recent commands
!42 # Rerun command number 42Tab completion: type less, do more
Tab completion is the biggest time-saver in the terminalWhat is terminal?A text-based interface where you type commands to interact with your computer. Also called the command line or shell.. Start typing something, then press Tab.
| What | Example |
|---|---|
| File paths | cd Doc<Tab> becomes cd Documents |
| Commands | git che<Tab> becomes git checkout |
| Git branches | git checkout fea<Tab> becomes git checkout feature-branch |
| Environment variables | echo $HO<Tab> becomes echo $HOME |
| npm scripts | npm run bu<Tab> becomes npm run build |
If there are multiple matches, press Tab twice to see them all:
cd Do<Tab><Tab>
# Documents/ Downloads/
cd Dow<Tab>
# Completes to: cd DownloadsYou can navigate entire paths with just a few keystrokes: cd /us<Tab>/bi<Tab> expands to cd /usr/bin.
Keyboard shortcuts for editing
When you are typing a long command and need to edit the beginning, do not hold the arrow key. Use these shortcuts:
| Shortcut | What it does |
|---|---|
Ctrl+A | Jump to start of line |
Ctrl+E | Jump to end of line |
Ctrl+U | Delete everything before cursor |
Ctrl+K | Delete everything after cursor |
Ctrl+W | Delete word before cursor |
Ctrl+L | Clear the screen |
Ctrl+C | Cancel current command |
Ctrl+D | Exit the terminal |
These shortcuts feel awkward at first. Force yourself to use them for a week, and they become muscle memory.
Aliases: create your own shortcuts
Do you find yourself typing the same long commands over and over? Create an alias: a custom shortcut.
# Temporary (current session only)
alias ll='ls -lah'
alias gs='git status'
alias gp='git push'
alias ..='cd ..'To make aliases permanent, add them to your shell configuration file:
# For Zsh (modern macOS): nano ~/.zshrc
# For Bash (most Linux): nano ~/.bashrc
# My custom aliases
alias ll='ls -lah'
alias gs='git status'
alias gp='git push'
alias gl='git log --oneline'
alias ..='cd ..'
alias ...='cd ../..'Save the file, then reload: source ~/.zshrc (or source ~/.bashrc).
| Alias | Command | Why it is useful |
|---|---|---|
ll | ls -lah | Detailed listing with hidden files |
gs | git status | Check Git status constantly |
gp | git push | Push code quickly |
gl | git log --oneline | View compact Git history |
.. | cd .. | Go up one level |
... | cd ../.. | Go up two levels |
find . -name "*.ts" -not -path "*/node_modules/*" | xargs grep -l "import" | sort | uniq -c | sort -rn | head -10. These are hard to debug when they fail, you have no idea which part went wrong. Break complex commands into separate steps. Run each part individually so you can verify the output at every stage. Only combine them once you know each piece works.Clipboard integration
Each OS has tools for copying text between the terminalWhat is terminal?A text-based interface where you type commands to interact with your computer. Also called the command line or shell. and clipboard:
# macOS
cat file.txt | pbcopy # Copy file contents to clipboard
pbpaste > file.txt # Paste clipboard to a file
pwd | pbcopy # Copy current directory path
# Linux (requires xclip)
cat file.txt | xclip -selection clipboard
xclip -o -selection clipboard > file.txtThe productivity mindset
Experienced developers are not typing faster, they are typing smarter. They use:
- Tab completion for everything (files, commands, branches)
- History (Up arrow and Ctrl+R) instead of retyping
- Keyboard shortcuts (Ctrl+A, Ctrl+E, Ctrl+K) for editing
- Aliases for commands they use constantly
These are not advanced techniques. They are fundamental habits.
Quick reference
| Shortcut/Command | What it does |
|---|---|
| Up arrow | Previous command |
| Down arrow | Next command |
| Ctrl+R | Search command history |
| Tab | Complete current word |
| Ctrl+A | Start of line |
| Ctrl+E | End of line |
| Ctrl+U | Delete to start |
| Ctrl+K | Delete to end |
| Ctrl+W | Delete previous word |
| Ctrl+L | Clear screen |
| Ctrl+C | Cancel command |