Skip to Content
This project is a work in progress. If you have any questions or suggestions, feel free to contact me.
LinuxLinux BasicsKeyboard Shortcuts

Keyboard Shortcuts in the Linux Terminal

Command Editing Shortcuts

ShortcutDescription
Ctrl + AMove the cursor to the start of the line
Ctrl + EMove the cursor to the end of the line
Ctrl + UCut (delete) everything from cursor to beginning of line
Ctrl + KCut (delete) everything from cursor to end of line
Ctrl + WCut (delete) the word before the cursor
Alt + DDelete the word after the cursor
Ctrl + YPaste the last cut text (yank)
Ctrl + LClear the screen (similar to clear command)
Ctrl + TSwap the last two characters before the cursor
Alt + .Insert the last argument from the previous command

Cursor Movement

ShortcutDescription
Ctrl + FMove cursor forward by one character
Ctrl + BMove cursor backward by one character
Alt + FMove forward one word
Alt + BMove backward one word

Command History Navigation

ShortcutDescription
Ctrl + RReverse search through command history
Ctrl + GExit search mode
Up / DownBrowse through previous/next commands in history
Ctrl + P / NSame as Up/Down arrows (Previous/Next)
!!Run the last command again
!abcRun the last command that starts with abc

Job Control and Terminal Control

ShortcutDescription
Ctrl + CTerminate the running command/process
Ctrl + ZSuspend the current foreground job
jobsShow background and suspended jobs
fgBring suspended job to foreground
bgResume job in background
Ctrl + DLog out of terminal / send EOF (End Of File)
Ctrl + SStop all output to the screen (XON/XOFF flow control)
Ctrl + QResume output to the screen

Tab Completion & Re-execution

ShortcutDescription
TabAuto-complete commands, paths, files
Tab TabShow all possible completions (if ambiguity)
!!Re-run the previous command
!nRun command number n from history

Screen and Terminal Multiplexers (Bonus)

If you use tmux or screen, you can detach sessions, switch between panes, etc., but that’s a deeper topic. Ask if you’d like to explore that too.

Summary Table

TaskShortcut
Move to start/end of lineCtrl + A / Ctrl + E
Clear screenCtrl + L
Cut word/back to startCtrl + W / Ctrl + U
Reverse searchCtrl + R
Terminate/suspend processCtrl + C / Ctrl + Z
Paste yanked textCtrl + Y
Search historyUp / Down or Ctrl + P/N
Auto-completeTab
EOF/ExitCtrl + D
Last updated on