Course:Internet & Tools/
Lesson

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 Enter

Searching 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 42
02

Tab 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.

WhatExample
File pathscd Doc<Tab> becomes cd Documents
Commandsgit che<Tab> becomes git checkout
Git branchesgit checkout fea<Tab> becomes git checkout feature-branch
Environment variablesecho $HO<Tab> becomes echo $HOME
npm scriptsnpm 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 Downloads

You can navigate entire paths with just a few keystrokes: cd /us<Tab>/bi<Tab> expands to cd /usr/bin.

03

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:

ShortcutWhat it does
Ctrl+AJump to start of line
Ctrl+EJump to end of line
Ctrl+UDelete everything before cursor
Ctrl+KDelete everything after cursor
Ctrl+WDelete word before cursor
Ctrl+LClear the screen
Ctrl+CCancel current command
Ctrl+DExit the terminal

These shortcuts feel awkward at first. Force yourself to use them for a week, and they become muscle memory.

04

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).

AliasCommandWhy it is useful
llls -lahDetailed listing with hidden files
gsgit statusCheck Git status constantly
gpgit pushPush code quickly
glgit log --onelineView compact Git history
..cd ..Go up one level
...cd ../..Go up two levels
AI pitfall
AI loves generating long one-liner command chains piped together, like 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.
05

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.txt
06

The productivity mindset

Experienced developers are not typing faster, they are typing smarter. They use:

  1. Tab completion for everything (files, commands, branches)
  2. History (Up arrow and Ctrl+R) instead of retyping
  3. Keyboard shortcuts (Ctrl+A, Ctrl+E, Ctrl+K) for editing
  4. Aliases for commands they use constantly

These are not advanced techniques. They are fundamental habits.

07

Quick reference

Shortcut/CommandWhat it does
Up arrowPrevious command
Down arrowNext command
Ctrl+RSearch command history
TabComplete current word
Ctrl+AStart of line
Ctrl+EEnd of line
Ctrl+UDelete to start
Ctrl+KDelete to end
Ctrl+WDelete previous word
Ctrl+LClear screen
Ctrl+CCancel command