Useful Linux Terminal Keyboard Shortcuts Cheat Sheet

While working on the Linux command-line environment, there is more to using this OS interface than just keying in and executing various commands with respect to the computing objective you wish to accomplish.

There are a variety of Linux command line keyboard shortcuts that will help you as a user in mastering command editing, command control, command recall, and other helpful command tweaks.

[ You might also like: Linux: Bash Built-in Commands Cheat Sheet ]

This article guide will walk us through some of these Linux command line keyboard shortcuts which should hopefully lessen the complexities around the usage of the Linux terminal environment.

Linux Terminal Command Editing Shortcuts

Command Usage
Ctrl + a This keyboard shortcut takes the blinking cursor to the beginning of a command.
Ctrl + e This keyboard shortcut takes the blinking cursor to the end of a command.
Ctrl + k Deletes everything between the cursor position and the end of the command.
Ctrl + u Deletes everything between the cursor position and the start of a command.
Ctrl + w Backward deletes one word from the cursor position.
Ctrl + y Pastes cut word/text (by deletion shortcut like Ctrl+w) in front of the cursor.
Ctrl + xx Enables navigation between the start of a command and the current cursor position.
Alt + b Navigate backward word by word from the current cursor position.
Alt + f Navigate forward word by word from the current cursor position.
Alt + d From the cursor position, delete to the end of the word.
Alt + u Make uppercase from the cursor position to the end of the word.
Alt + l Make lowercase from the cursor position to the end of the word/text.
Alt + t Swap previous with current word.
Ctrl + f Move a character forward from the cursor position.
Ctrl + b Move a character backward from the cursor position.
Ctrl + d Delete the character highlighted by the cursor.
Ctrl + h Delete the character behind the cursor.
Ctrl + t swap the character under the cursor with the previous one.

Linux Terminal Command Control Shortcuts

Command Usage
Ctrl + l Clear the terminal screen of all commands.
Ctrl + s Prevents printing output to the screen when running verbose commands.
Ctrl + q Re-allows output to the terminal screen previously stopped by Ctrl + s.
Ctrl + c Terminates a command’s execution.
Ctrl + z Stops or suspends a command.

Linux Command Recall Shortcuts

Command Usage
Ctrl + r Search command history backward.
Ctrl + g Escape from history searching mode.
Ctrl + p Prints previous command from the command history.
Ctrl + n Walk you through printed command history commands.
Alt + . Adopts the previous command’s last word.

Linux Bash Bang (!) Commands Shortcuts

Command Usage
!! Executes the most recently executed command.
!ping Executes a recently executed command starting with the word ping.
!ping:p Prints previously executed command associated with ping and make it the latest addition in the command history.
!$ Prints the previously executed command’s last word.
!$:p Prints out the substitute word for !$.
!* Prints out previously executed command with exception to its last word associate.
!*:p Prints a possible substitute for !*.

With this Linux Command Line keyboard shortcuts cheat sheet, you should be able to attain more productivity in the Linux terminal environment.

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.