Skip to main content
⚡ OpenDevDocs
Fundamentals
fundamentalsterminalGuideBeginner

Terminal Fundamentals

Core terminal concepts: terminal emulator vs. shell, standard keyboard shortcuts, piping, redirection, and essential CLI navigation.

Verified: 2026-09-30
Platforms:
all
#terminal#cli#shell#bash#zsh#fundamentals

Terminal Fundamentals

The Command Line Interface (CLI) is the most direct way to interact with an operating system. Becoming proficient in the terminal accelerates development workflows, unlocks automation scripting, and is required for managing remote cloud servers.


1. Terminal Emulator vs. Shell

Developers often use these terms interchangeably, but they perform distinct functions:

ComponentDefinitionExamples
Terminal EmulatorThe graphical GUI window that displays text, receives keyboard keystrokes, and handles font/color rendering.Ghostty, iTerm2, Alacritty, VS Code integrated terminal, Windows Terminal
ShellThe text-based command interpreter program running inside the terminal that parses inputs, executes binaries, and manages environment state.zsh (macOS default), bash (Linux default), fish, PowerShell

2. Essential Keyboard Shortcuts

Mastering keyboard shortcuts prevents tedious typing mistakes:

ShortcutAction
Ctrl + CSend SIGINT interrupt signal to immediately kill/stop the currently running command.
Ctrl + L (or clear)Clear the terminal viewport without deleting session history.
Ctrl + A / Ctrl + EJump cursor to the very beginning / end of the current command line.
Ctrl + U / Ctrl + KCut everything from cursor to the beginning / end of line.
Ctrl + RInteractive reverse history search (type characters to find previous commands).
TabAutocomplete filename, directory path, or command flags.
Up / Down ArrowsCycle through previous command history.

3. Standard Streams, Redirection & Pipes

Every terminal program executes with three default I/O streams:

  • stdin (0): Standard Input (keyboard keystrokes or piped text).
  • stdout (1): Standard Output (normal program results printed to screen).
  • stderr (2): Standard Error (diagnostic error messages printed to screen).

Stream Redirection Operators

# Overwrite file with stdout:
echo "DATABASE_URL=postgres://..." > .env

# Append stdout to end of file without overwriting:
echo "PORT=3000" >> .env

# Redirect stderr to a log file:
pnpm build 2> build-errors.log

# Discard all output (black hole):
npm test > /dev/null 2>&1

Piping (|)

The pipe operator | connects the stdout of one command directly into the stdin of the next command:

# Search for active node processes:
ps aux | grep node

# Count how many typescript files exist in src/:
find src/ -name "*.tsx" | wc -l

On this page