Dozen of Linux Shortcuts to save your Day

SamJain
3 min readMay 28, 2022

--

1. Ctrl + A
This shortcut will move the cursor to the beginning of the line.
Suppose you typed a long command or path in the terminal and you want to go to the beginning of it, using the arrow key to move the cursor will take plenty of time. Do note that you cannot use the mouse to move the cursor to the beginning of the line.

2. Ctrl + C
These are the keys you should press in order to break out of a command or process on a terminal. This will stop a running program immediately.
If you want to stop using a program running in the foreground, just press this key combination.

3. Ctrl + D
This keyboard shortcut will log you out of the current terminal. If you are using an SSH connection, it will be closed. If you are using a terminal directly, the application will be closed immediately.
Consider it equivalent to the ‘exit’ command.

4. Ctrl + E
This shortcut is sort of opposite to Ctrl+A. it moves the cursor to the end of the line.
Its equivalent to Home Ctrl+A and End Ctrl+E keys on your keyboard, you can also use them.

5. Ctrl + K
This one is similar to the Delete key in your keyboard. It erases everything from the current cursor position to the end of the line.

6. Ctrl + L
How do you clear your terminal screen? I guess using the clear command.
Instead of writing C-L-E-A-R, you can simply use Ctrl+L to clear the terminal. Handy, isn’t it?

7. Ctrl + P and Ctrl + N
You can use these shortcut in conjugation.
Ctrl +P displays previous command. You can press it repeatedly to keep on going back in the command history. In a lot of terminals, the same can be achieved with PgUp key.
Ctrl +N displays the next command. If you are viewing previous commands with Ctrl+P, you can use Ctrl+N to navigate back and forth. Many terminals have this shortcut mapped to the PgDn key.

8. Ctrl + R (My Fav)
You can use this to search in command history
You typed some command but cannot remember what it was exactly? Meet Ctrl + R.
This keyboard shortcut allows you to perform a search in your command history. Just press Ctrl+R and start typing. It will show the last command that matches the string you typed. Note that the typed string could be anywhere in the command. How cool is that?
Reverse search in command history in Linux
If you want to see more commands for the same string, just keep pressing
Ctrl +R. You can press enter to run the command selected or press Esc to come out of the search with the last search result.

9. Ctrl + U
Typed a wrong command? Instead of using the backspace to discard the current command, use Ctrl+U shortcut in the Linux terminal. This shortcut erases everything from the current cursor position to the beginning of the line.

10. Ctrl + W
You just learned about erasing text till the beginning Ctrl +U and the end
Ctrl +K of the line. But what if you just need to delete a single word? Use the Ctrl+W shortcut.
Using this shortcut, you can erase the word preceding to the cursor position. If the cursor is on a word itself, it will erase all letters from the cursor position to the beginning of the word.

The best way to use it to move the cursor to the next space after the targeted word and then use the Ctrl+W keyboard shortcut.

11. Ctrl + Y
This will paste the erased text that you saw with Ctrl + W, Ctrl + U and Ctrl + K shortcuts. Comes handy in case you erased wrong text or if you need to use the erased text someplace else.

12. Ctrl + Z
This shortcut will send a running program in the background. Normally, you can achieve this before running the program using the & option but if you forgot to do that, use this key combination.

Try it and be amazed.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

SamJain
SamJain

Written by SamJain

Hi, I am Sampada Jain, a system and Cloud Technologies enthusiast. I find learning technologies easy and love to trouble-shoot errors. Passionate Linux learner.

No responses yet

Write a response