What keyboard shortcuts are essential for the Linux command line?
The must-know few: Ctrl+C cancels, Ctrl+D ends input, Tab auto-completes, ↑/↓ recall history, and Ctrl+R searches history.
These aren't trivia — they're the difference between fighting the command line and flying through it. They fall into three jobs: controlling a running command, editing the line you're typing, and recalling what you typed before.
| Shortcut | Action | Why it matters |
|---|---|---|
| Ctrl+C | Cancel the running command | Your escape hatch when something hangs or runs away |
| Ctrl+D | End of input / logout | Signals "no more input" — exits the shell on an empty line, or ends what a command is reading |
| Ctrl+L | Clear the screen | Same as clear, but keeps your half-typed line |
| Ctrl+A / Ctrl+E | Jump to line start / end | Fix the front of a long command without holding ← |
| Ctrl+U / Ctrl+K | Delete to line start / end | Wipe a line you want to retype, or chop off a tail |
| Ctrl+R | Reverse-search history | Type a fragment, it finds the matching past command |
| Tab | Auto-complete command/path | Fewer keystrokes, and it can't misspell a real filename |
| ↑ / ↓ | Walk through history | Re-run or tweak a previous command |
Key gotcha — Ctrl+C vs Ctrl+D: Ctrl+C interrupts (sends a "stop now" signal to a running program). Ctrl+D is end-of-file — it doesn't kill anything, it tells a program "input is over." Pressing Ctrl+D at an empty prompt therefore logs you out, because you've told the shell there's no more input coming.
Tip: Tab once completes if there's a single match; Tab twice lists all options when several match.
Go deeper:
signal(7) — Linux manual page — SIGINT ("Interrupt from keyboard"), the signal Ctrl+C sends — clarifying Ctrl+C vs Ctrl+D.