Hotkeys and shortcuts for Bash (Unix shell)

(Total 38)

Ctrl + C
Working with processes
Kill current foreground process running in the terminal
Ctrl + Z
Working with processes
Suspend the current foreground process running in bash
Ctrl + D
Deleting text
Delete the character under the cursor
Ctrl + L
Controlling the screen
Clear the screen
Ctrl + S
Controlling the screen
Stop all output to the screen. This can be useful when running commands with very long output, but you don't want to stop the command with Ctrl + C
Ctrl + Q
Controlling the screen
Resume output to the screen after stopping it with Ctrl + S
Ctrl + A
Moving the cursor
Go to the beginning of the line
Home
Moving the cursor
Go to the beginning of the line
Ctrl + E
Moving the cursor
Go to the end of the line
End
Moving the cursor
Go to the end of the line
Ctrl + B
Moving the cursor
Go left one character
Alt + F
Moving the cursor
Go right one word
Ctrl + F
Moving the cursor
Go right one character
Ctrl + X then X
Moving the cursor
Move between the beginning of the line and the current position of the cursor. This allows you to change something and return to original position
Del
Deleting text
Delete the character under the cursor
Alt + D
Deleting text
Delete all characters after the cursor on the current line
Ctrl + H
Deleting text
Delete the character before the cursor
⬅ Backspace
Deleting text
Delete the character before the cursor
Alt + T
Correcting text
Swap the current word with the previous word
Ctrl + T
Correcting text
Swap the last two characters before the cursor with each other
Ctrl + _
Correcting text
Undo your last key press. It can be used multiple times
Esc + T
Correcting text
Swap the last to words before the cursor
Ctrl + W
Cut and paste
Cut the word before the cursor and add it to the clipboard
Ctrl + K
Cut and paste
Cut the part of the line after the cursor and add it to the clipboard
Ctrl + U
Cut and paste
Cut the part of the line before the cursor and add it to the clipboard
Ctrl + Y
Cut and paste
Paste the last thing you cut from the clipboard. The y here stands for “yank”
Alt + U
Capitalizing characters
Capitalize every character from the cursor to the end of the current word, converting the characters to upper case
Alt + L
Capitalizing characters
Uncapitalize every character from the cursor to the end of the current word, converting the characters to lower case
Alt + C
Capitalizing characters
Capitalize the character under the cursor. Your cursor will move to the end of the current word.
⭾ Tab
Tab completion
Automatically complete the file, directory, or command you’re typing
Ctrl + P
Command history
Go to the previous command in the command history
Command history
Go to the previous command in the command history
Ctrl + N
Command history
Go to the next command in the command history
Command history
Go to the next command in the command history
Alt + R
Command history
Revert any changes to a command you've called from your history, if you've edited it
Ctrl + R
Command history
Recall the last command matching the characters you provide. Press this shortcut and start typing to search your bash history for a command
Ctrl + O
Command history
Run a command you found with Ctrl + R
Ctrl + G
Command history
Leave history searching mode without running a command