fbpx Linux Keyboard Shortcuts: Most Used in Terminal | Certificação Linux

Linux Keyboard Shortcuts: Terminal, Bash, and Desktop (Complete Guide)

📅 03/07/2022 ⏱ 9 min ✍️ Uira Ribeiro
Linuxcommands
Linux Keyboard Shortcuts: Terminal, Bash, and Desktop (Complete Guide)
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

Do you know what differentiates a professional user from a regular user? Mastery of keyboard shortcuts.

Alright! That's not the only thing, but it's undoubtedly a factor.

Linux shortcuts help you be more productive and efficient with any tool you use. Just think about it. If someone kept scrolling down with the mouse to copy all the text instead of Ctrl + A, how would you feel about that?

The Linux terminal is no exception. There are certain Linux terminal shortcuts that every user should know and practice.

Trust me! Once you master these shortcuts, you'll realize how good you are at using the Linux command line.

14 Linux keyboard shortcuts you need to know

linux keyboard shortcuts
Photo: Pexels | Linux shortcuts that make daily life easier.

To make your daily routine and productivity increasingly easier in the Linux system, there are some extremely useful shortcuts that can save you time and energy. 

Here, we list the 14 main ones that, if you master and always use, you can achieve great results, increasing productivity. Check out what they are!

1. Tab (auto-complete)

Just start typing a command, file name, directory name, or even command options and press the tab key. It will automatically complete what you were typing or show you all possible results.

2. Ctrl + C (stops a program)

These are the keys you should press to exit a command or process in a terminal. This will immediately stop a running program.

If you want to stop using a program running in the foreground, just press this key combination.

92% pass rate on LPI exams

3. Ctrl + Z (background)

This shortcut will send a running program to the background. Usually, you can achieve this before running the program by using the & option, but if you forgot to do this, use this key combination.

4. Ctrl + D (disconnect)

This Linux shortcut disconnects you from 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.

5. Ctrl + L (clears the terminal)

How do you clear your terminal screen? I think using the clear command.

Instead of typing C-L-E-A-R, you can simply use Ctrl + L to clear the terminal. Muuuuch better, right?

6. Ctrl + A (moves to beginning of line)

This shortcut will move the cursor to the beginning of the line.

Suppose you typed a long command or path in the terminal and want to go to the beginning of it, using the arrow key to move the cursor would take quite a while. Note that you cannot use the mouse to move the cursor to the beginning of the line.

7. Ctrl + E (moves to end of line)

This shortcut is somewhat the opposite of Ctrl + A. Ctrl + A sends the cursor to the beginning of the line, while Ctrl + E moves the cursor to the end of the line.

8. Ctrl + U (clears the line)

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

9. Ctrl + K (clears from cursor forward)

This is similar to the Ctrl + U shortcut. The only difference is that, instead of from the beginning of the line, it clears everything from the current cursor position to the end of the line.

10. Ctrl + W (clears a word)

But what if you only need to delete a single word? Use the Ctrl + W shortcut.

Using the Ctrl + W shortcut, you can delete the word before the cursor position. If the cursor is within a word itself, it will delete all letters from the cursor position to the beginning of the word.

11. Ctrl + Y (paste back)

This will paste the deleted text you saw with the Ctrl + W, Ctrl + U, and Ctrl + K shortcuts. It comes in handy in case you deleted the wrong text or if you need to use the deleted text elsewhere.

12. Ctrl + P (previous command)

You can use this Linux shortcut to view the previous command. You can press it repeatedly to continue going back through the command history. In many terminals, the same can be achieved with the PgUp key.

13. Ctrl + N (next command)

You can use this shortcut in conjunction with Ctrl + P. Ctrl + N displays the next command. If you are viewing previous commands with Ctrl + P, you can use Ctrl + N to navigate forward and backward. Many terminals have this shortcut mapped to the PgDn key.

14. "alias" command

You typed a cool combination of commands that you have to repeat all the time? Use the alias command to create your own shortcut:

$ alias conexoes="netstat -plan|grep :80|awk '{print $5}'|cut -d: -f 1|sort|uniq -c|sort -nk 1"

Summary tables for Linux shortcuts (by categories)

There are several Linux commands and shortcuts, aren't there? To make it easier for you to understand and apply these shortcuts in your daily routine, we put together a complete table, by categories, that will help you whenever you need. 

We recommend that you save this page in your favorites or in an easily accessible folder on your computer. 

That way, with just a few clicks, you can remember all the commands and insert them into your routine naturally!

Basic shortcuts

Linux basic shortcuts are those that need to be "stuck" in your mind and at your fingertips, literally. 

After all, it's with them that basic and everyday actions will be executed, without you having to think much to do them. 

Request online help from the Linux communityF1
Perform a quick text searchF2 
Advance one search result within the F2 shortcutF3
Go back one search result from the search within F2Shift+F3
Refresh a page, just like in WindowsF5
Open the Linux spell checker (very useful if you are writing)F7
Select all text on a pageCtrl+A
Make selected text boldCtrl+B
Make selected text italicCtrl+I
Make selected text underlinedCtrl+U
Save your file (mainly useful in text editors)Ctrl+S

Terminal navigation

You need to perform terminal navigation simply and quickly. 

After all, agility and simplicity need to be part of the daily work routine of IT teams that execute their processes on Linux. 

An easy way to do this is by combining specific shortcuts, which will enable simple navigation. See below:

Switch between applicationsSuper+Tab or Alt+Tab
Lock the screen Super+L or Ctrl+Alt+L
Minimize open windowsSuper+D or Ctrl+Alt+D
Close all windowsCtrl+Q or Ctrl+W.
Log out (shut down)Ctrl+Alt+Del
Certification in under 90 days

Working with processes

To work with processes in Linux, it is very simple. You just need to know which shortcut works for the action you want to execute. 

If you want to interrupt, disconnect, clear, or execute processes in the background, for example, there are specific commands: 

Interrupt a programCtrl + C
BackgroundCtrl + Z
DisconnectCtrl + D
Clears the terminalCtrl + L
Move to the beginning of the lineCtrl + A
Move to the end of the lineCtrl + E
Delete the lineCtrl + U
Delete from cursor onwardsCtrl + K
Delete one wordCtrl + W
Paste backCtrl + Y
Previous commandCtrl + P
Next commandCtrl + N

Managing workspaces

In Linux, you can also switch and manage all open workspaces, just like in Windows. Likewise, you just need to combine commands and execute actions in these workspaces: 

Switch between workspacesCtrl + Alt + →↓↑← (setas)
Switch to the workspace aboveCtrl + Alt + ↑ (seta para cima no teclado)
Switch to the workspace belowCtrl + Alt + ↓ (seta para baixo no teclado)
Switch to the workspace on the rightCtrl + Alt + → (seta direita no teclado)
Switch to the workspace on the leftCtrl + Alt + ← (seta esquerda no teclado)
Move window to the workspace aboveCtrl + Alt + Shift + ↑ (seta para cima)
Move window to the workspace belowCtrl + Alt + Shift + ↓ (seta para baixo)
Move window to the workspace on the leftCtrl + Alt + Shift + ← (seta para esquerda)
Move window to the workspace on the rightCtrl + Alt + Shift + → (seta para direita)
Show all existing and running windows and workspacesTecla Windows + W

Command history

To query or redo a recent action that was performed using a command or shortcut in Linux, you just need to check your recent command history! 

They are all stored in short-term memory and can be accessed and reproduced whenever you need: 

Access the previous command in the command history. Ctrl+P or ↑ (seta para cima)
Go back in the command history (query several previous commands)Press Ctrl+P or ↑ (seta para cima) several times
Access the next command in the command history. Ctrl+N or ↓ (seta para baixo)
Go back in the command history (advance through the commands in the history)Press Ctrl+N or ↓ (seta para baixo) several times
Revert changes to a command you pulled from your history, if it had been edited.Alt+R 

How to create custom shortcuts in Linux?

custom linux shortcuts
Photo: Pexels | How to create custom Linux shortcuts.

If you didn't find the shortcut you're looking for, you can simply create a custom one for yourself! The step-by-step is very simple, check it out:

  • access the Linux system settings menu;
  • click on the "keyboard" icon;
  • open the "shortcuts" tab;
  • select "custom shortcuts";
  • click on the "+" icon, next to the word;
  • a window will open for you to register your new shortcut;
  • enter the shortcut name, such as "run action X" and the command it encompasses;
  • select the "apply changes" or "save" button;
  • done, your shortcut has been created! Now, just enable it for use by selecting the "enable" option, if it is "disabled";
  • press the key combination you want the shortcut to be activated with, such as alt + 3, for example;
  • now, everything is ready for use! 

Did you see how easy it is? If before you used Windows and now you use Linux, but migrated with certain habits or vices in terms of shortcuts, you can just create similar shortcuts to the ones you were already used to, in a customized way.

Conclusion

linux shortcuts usage
Photo: Pexels | How to use Linux shortcuts.

We hope this article has helped you get to know and master all the various existing Linux shortcuts! 

This simple key combination on your keyboard can really increase your productivity and make processes as automated as possible. 

If you enjoy content related to the Linux universe, whether tutorials, tips, or even training, you need to check out the Certificação Linux Blog! 

On it, you will find very interesting articles on various topics, such as systemd, containers, processes, Kali Linux tools and much more! Whether you are a beginner or advanced in using this operating system, you can benefit from the shared content. It's worth checking out! 

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp