DEV Community

Cover image for Keyboard Shortcuts For Linux Terminal
yash sugandh
yash sugandh

Posted on

Keyboard Shortcuts For Linux Terminal

In the last post, we looked at the use of an Alternative of find command fd command.

Today, we are going to have a look at the keyboard shortcuts for Linux Terminal that will make our life easier.

Let's have a look at some basic and most useful commands

Keyboard Shortcut Use of the keyboard shortcut
Ctrl-Alt-t Open a new Terminal
Ctrl-d Close a terminal
Ctrl-c Cancels the currently running command.
Ctrl-l Clears the screen just like clear command

In the above command, the one that I use the most is the Ctrl-l since it allows me to clear the screen without the need of typing the clear command again and again.

Now, Let's have a look at some advanced commands to help our movement in terminal

Keyboard Shortcut Use of the keyboard shortcut
Ctrl-a Move the cursor to the beginning of the line
Ctrl-e Move the cursor to the end of the line
Ctrl-f Move the cursor forward by one character
Ctrl-b Move the cursor backward by one character
Alt-f Move the cursor forward by one word
Alt-b Move the cursor backward by one word

We can use home and end key to move at the beginning and end of the line as well.

The ability to move at the beginning or end of a word using Alt-f Alt-b is what I find most useful since we don't have to move back character by character.

Now let's have a look at some shortcuts that can help us in modifying text

Keyboard Shortcut Use of the keyboard shortcut
Ctrl-d Delete the character at the cursor location
Ctrl-t Exchange the character at the current location with the character at preceding it
Ctrl-u Erases the complete line
Alt-t Exchange the word at the current location with the word at preceding it
Alt-l Move the cursor backward by one character
Alt-u Convert the characters of a word to lowercase from the current cursor location
Alt-b Convert the characters of a word to uppercase from the current cursor location

Alt-t is something that you don't think you need until you start using it.

So this is all for today. Let me know what's your most used and if I missed something just let me know in the discussion below.

You can also join me on my journey of Linux-for-beginners series

Top comments (1)

Collapse
 
tkainrad profile image
Thomas Kainrad

Nice post! Terminal shortcuts are underused, even by command-line pros.
Btw, KeyCombiner has a similar list and enables you to organize and learn them: keycombiner.com/collecting/collect...