Mastering the Terminal: Keyboard Shortcuts

A collection of essential Bash keyboard shortcuts that every Linux admin should know to work faster and more efficiently.


๐Ÿงผ Screen & Shell Management

Shortcut

Action

Equivalent Command

Ctrl + L

Clear the terminal screen

clear

Ctrl + D

Exit the shell

exit


๐Ÿ” Command History Navigation

Shortcut

Action

โ†‘ (Up Arrow)

Navigate to the previous command in history

โ†“ (Down Arrow)

Navigate forward through the history


๐Ÿงญ Cursor Movement

Shortcut

Action

Ctrl + A

Move cursor to the start of the line

Ctrl + E

Move cursor to the end of the line

โœ… Example Use Case:

# Run a command:
ls -l /etc/passwd

# Use โ†‘ to recall it
# Use Ctrl + A to jump to the beginning
# Replace 'ls' with 'cat' and remove '-l'

โœ‚๏ธ Cutting & Clearing

Shortcut

Action

Ctrl + U

Cut everything before the cursor and copy to clipboard

โœ… Useful for:

  • Quickly clearing a mistaken password entry.

  • Replacing a large part of the command without backspacing.


๐Ÿšซ Process Control

Shortcut

Action

Notes

Ctrl + C

Interrupt (terminate) a running process

e.g., Stop ping, wget, etc.

Ctrl + Z

Pause/Suspend a running process

Can be resumed later with bg

โœ… Example:

# Run a long command (e.g., ping)
ping 8.8.8.8

# Press Ctrl + Z โ†’ suspends it
# Resume it with: bg %1

Updated on