Foundations Module 4 · Cheat Sheets

Keyboard Shortcuts

Speed up your terminal workflow with essential shortcuts

These shortcuts work in most terminals on all operating systems. They’ll save you enormous amounts of time.

The Essential Five

Learn these first — they're the ones you'll use every day

ShortcutWhat it doesWhen to use it
TabAuto-complete file/folder namesAfter typing the first few letters of a name
Up ArrowPrevious command from historyWhen you want to repeat or modify a recent command
Ctrl + CCancel/stop current processWhen something is stuck or you want to abort
Ctrl + LClear the screenWhen your terminal feels cluttered
Ctrl + DExit the terminal / end inputWhen you’re done or want to close a session
💡Tab completion is your superpower

Instead of typing cd my-really-long-project-name, type cd my and press Tab. If there’s only one match, it completes instantly. If there are multiple matches, press Tab twice to see all options. This works for commands, file names, and folder names.

Navigation Within a Line

Moving your cursor around the current command

ShortcutWhat it does
Ctrl + AJump to beginning of line
Ctrl + EJump to end of line
Ctrl + WDelete word before cursor
Ctrl + UDelete from cursor to beginning of line
Ctrl + KDelete from cursor to end of line
Ctrl + YPaste what you just deleted (yank)
Alt + BJump back one word
Alt + FJump forward one word

History

Navigating and searching your command history

ShortcutWhat it does
Up / Down arrowsScroll through previous commands
Ctrl + RSearch command history (start typing to filter)
!!Repeat the last command
!$Use the last argument from the previous command
historyShow full command history
history | grep keywordSearch history for a specific command
Ctrl+R is incredibly useful

Press Ctrl+R, then start typing part of a command you used before. The terminal will search your history and show the most recent match. Press Ctrl+R again to cycle through older matches. Press Enter to run it, or Esc to cancel. This is one of the biggest time-savers once you get used to it.

Process Control

Managing running commands

ShortcutWhat it does
Ctrl + CKill the current process
Ctrl + ZSuspend the current process (pause it)
fgResume a suspended process in foreground
bgResume a suspended process in background
Ctrl + DSend EOF (end of file) — closes the terminal

Useful Operators

Combining and redirecting commands

OperatorWhat it doesExample
&&Run next command only if first succeedsmkdir app && cd app
||Run next command only if first failstest -f file || echo "not found"
>Redirect output to file (overwrite)echo "hello" > file.txt
>>Redirect output to file (append)echo "more" >> file.txt
|Pipe output of one command to anotherls | grep ".txt"

Building muscle memory

You don’t need to memorize all of these at once. Here’s a learning sequence:

  1. Week 1: Tab, Up Arrow, Ctrl+C — these three alone transform your experience
  2. Week 2: Add Ctrl+L, Ctrl+A, Ctrl+E
  3. Week 3: Add Ctrl+R for history search
  4. Beyond: The rest will come naturally as you work

The goal isn’t to memorize a table — it’s to reach for these shortcuts instinctively. That only happens through practice.