Skip to content

Instantly share code, notes, and snippets.

@Sahu-Ayush
Last active August 18, 2022 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sahu-Ayush/97e3733fe9688e8096a31380071acbf0 to your computer and use it in GitHub Desktop.
Save Sahu-Ayush/97e3733fe9688e8096a31380071acbf0 to your computer and use it in GitHub Desktop.
Terminal shortcuts for Linux. Blog

In this article, I share some shortcuts that I believe are useful to the broadest range of the sysadmin community. They are a vital part of my life and allow me to save time and focus better on what I enjoy doing. I also provide a quick tip at the end to help you master any Linux shortcuts.

Shortcuts are a key or combination of keys that provide quick access to a specific task or command. Almost everyone uses computer shortcuts in some form or fashion, but they are particularly critical for Linux sysadmins.

Note, most of these tricks assume you are using a Bash shell. They may be similar in other shells, but be aware there could be subtle differences.

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

Key Description
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.
Ctrl + z To pause the process. It will not terminate your program, it will keep your program in background. You can restart your program from that point where you used ctrl z.

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

Key Description
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.

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

Key Description
Ctrl + d Delete the character at the cursor location.
Ctrl + w Delete the word left of the cursor.
Alt + d or Esc + d Delete the word right of the cursor.
Ctrl + t Exchange the character at the current location with the character at preceding it.
Ctrl + u Delete all words left of the cursor or erases the complete line.
Ctrl + k Delete all words right of the cursor or 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.

So this is all for today. Hope this helps! Let me know what's your most used and if I missed something just let me know in the comment below. Also, you contribute to the GitHub Gist. Here is the link: Terminal-shortcuts-for-Linux.

@Sahu-Ayush
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment