More than 35 Keyboard Shortcuts for Terminal in Linux



Bash is the default command-line shell on most Linux distributions. The bash shell features a wide variety of keyboard shortcuts you can use. These will work in bash on any operating system. Some of them may not work if you’re accessing bash remotely through an SSH or telnet session, depending on how you have your keys mapped.

Working With Processes
Use the following shortcuts to manage running processes.

Ctrl + CInterrupt (kill) the current foreground process running in the terminal. This sends the SIGINT signal to the process, which is technically just a request—most processes will honor it, but some may ignore it
Ctrl + ZSuspend the current foreground process running in bash. This sends the SIGTSTP signal to the process. To return the process to the foreground later, use the fg process_name command
Ctrl + DClose the bash shell. This sends an EOF (End-of-file) marker to bash, and bash exits when it receives this marker. This is similar to running the exit command

Controlling the Screen
The following shortcuts allow you to control what appears on the screen.

Ctrl + LClear the screen. This is similar to running the “clear” command
Ctrl + SStop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don’t want to stop the command itself with Ctrl+C
Ctrl + QResume output to the screen after stopping it with Ctrl+S

Moving the Cursor
Use the following shortcuts to quickly move the cursor around the current line while typing a command.

Ctrl + A
Ctrl + Home
Go to the beginning of the line
Ctrl + E
Ctrl + End
Go to the end of the line
Alt + BGo left (back) one word
Ctrl + BGo left (back) one character
Alt + FGo right (forward) one word
Ctrl + FGo right (forward) one character
Ctrl + XXMove between the beginning of the line and the current position of the cursor. This allows you to press Ctrl+XX to return to the start of the line, change something, and then press Ctrl+XX to go back to your original cursor position. To use this shortcut, hold the Ctrl key and tap the X key twice

Deleting Text
Use the following shortcuts to quickly delete characters

Ctrl + D
Delete
Delete the character under the cursor
Alt + DDelete all characters after the cursor on the current line
Ctrl + H
Backspace
Delete the character before the cursor

Fixing Typos
These shortcuts allow you to fix typos and undo your key presses.

Alt + TSwap the current word with the previous word
Ctrl + TSwap the last two characters before the cursor with each other. You can use this to quickly fix typos when you type two characters in the wrong order
Ctrl + _Undo your last key press. You can repeat this to undo multiple times

Cutting and Pasting
Bash includes some basic cut-and-paste features.

Ctrl + Shift + CCopy the selected text from terminal
Ctrl + Shift + VPaste the content from clipboard
Shift + InsertCopy selected text to clipboard and paste from the clipboard
Ctrl + WCut the word before the cursor, adding it to the clipboard
Ctrl + KCut the part of the line after the cursor, adding it to the clipboard
Ctrl + UCut the part of the line before the cursor, adding it to the clipboard
Ctrl + YPaste the last thing you cut from the clipboard. The y here stands for “yank”

Capitalizing Characters
The bash shell can quickly convert characters to upper or lower case

Alt + UCapitalize every character from the cursor to the end of the current word, converting the characters to upper case.
Alt + LUncapitalize every character from the cursor to the end of the current word, converting the characters to lower case.
Alt + CCapitalize the character under the cursor. Your cursor will move to the end of the current word.

Working With Your Command History
You can quickly scroll through your recent commands, which are stored in your user account’s bash history file

Ctrl + P
Up Arrow
Go to the previous command in the command history. Press the shortcut multiple times to walk back through the history.
Ctrl + N
Down Arrow
Go to the next command in the command history. Press the shortcut multiple times to walk forward through the history.
Alt + RRevert any changes to a command you’ve pulled from your history if you’ve edited it.
Ctrl + RRecall the last command matching the characters you provide. Press this shortcut and start typing to search your bash history for a command.
Ctrl + ORun a command you found with Ctrl+R.
Ctrl + Jit End the Ctrl+R search
Ctrl + GLeave history searching mode without running a command.


Comments