Linux: Bash Cheat Sheet

# ALT Key
ALT+AGo to the beginning of a line.
ALT+BMove one character before the cursor.
ALT+CSuspends the running command/process.
ALT+DCloses the empty Terminal (I.e it closes the Terminal when there is nothing typed). It also deletes all characters after the cursor.
ALT+FMove forward one character.
ALT+T Swaps the last two words.
ALT+UCapitalize all characters in a word after the cursor.
ALT+L Uncapitalize all characters in a word after the cursor.
ALT+RUndo any changes to a command that you have brought from the history if you’ve edited it.
# CTRL Key
CTRL+AQuickly move to the beginning of the line.
CTRL+BTo move backward one character.
CTRL+CStop the currently running command.
CTRL+DDelete one character backward.
CTRL+EMove to the end of the line.
CTRL+F Move forward one character.
CTRL+GLeave the history searching mode without running the command.
CTRL+HDelete the characters before the cursor, the same as Backspace.
CTRL+JSame as Enter/ Return key.
CTRL+KDelete all characters after the cursor.
CTRL+LClears the screen and redisplay the line.
CTRL+MSame as CTRL+J or RETURN.
CTRL+NDisplay the next line in the command history.
CTRL+ORun the command that you found using reverse search i.e CTRL+R.
CTRL+PDisplays the previous line in the command history.
CTRL+RSearches the history backward (Reverse search).
CTRL+SSearches the history forward.
CTRL+TSwaps the last two characters.
CTRL+UDelete all characters before the cursor (Kills backward from point to the beginning of the line).
CTRL+VMakes the next character typed verbatim.
CTRL+WDelete the words before the cursor.
CTRL+XLists the possible filename completions of the current word.
CTRL+XXMove between the start of the command line and the current cursor position (and back again).
CTRL+YRetrieves the last item that you deleted or cut.
CTRL+ZStops the current command.
CTRL+[Equivalent to ESC key.
# Miscellaneous
!!Repeat last command
!nameRun the last command starting with ‘name’
!name:pPrint the last command starting with ‘name’
!$Last argument of the previous command
ALT-.Last argument of the previous command
!*All arguments of the previous command
^name^anotherRun the previous command, replacing ‘name’ with ‘another’

Leave a Reply

Your email address will not be published. Required fields are marked *