Special offer
popup-offers
English
+370 5 205 5502 sales@monovm.com

The Most Important Shortcuts in Linux

Shortcuts are an efficient and effective way that you can use to avoid writing long commands or using manual long methods to achieve a particular task in Linux. If you perform a particular task more frequently than others, you should check for a shortcut of that command so that it would help you save a lot of time later on. For example, if you want to open a particular link several times, instead of going to the browser and navigating to the link multiple times, you can set a keyboard shortcut using the curl command to open the link. Or if you visit a directory multiple times, you can set a keyboard shortcut for that by simply setting a command such as a nautilus or any other file manager that you use along with the path to that directory for a combination of keys.

18 Mar, 21 by Antoniy Yushkevych 6 min Read

Learn what are the most useful Linux shortcuts

Similar to these, there are tons of shortcuts that are already available that you can use in place of how you would perform those operations traditionally. In general, we divide these types of shortcuts in any Linux machine into two categories - Keyboard key Shortcuts and Command-Line shortcuts. In this comprehensive article, we will explain a few of them from both categories.

To move ahead with this article, please make sure that you have access to a Linux machine, a Command-Line terminal, and sudo privileges. Also, working with sudo privileges is always risky and you might find yourself creating a mess of your system if you try to fiddle around with configuration files. So, we urge you to play safe with the below-mentioned commands to avoid any mishap.

 

Keyboard Shortcuts in Linux

Pressing a shortcut key or a combination of keys invokes a command which runs a program or an application based on the command associated with those keys. Also, a few shortcuts might not be compatible with every flavor of Linux but most of them work for all the Linux/Unix distributions. 

 

  1. Navigating in Terminal using Tab - We can use the tab key to auto-complete a directory while we specify one in the terminal. We just need to start entering the name of the directory and press the tab key in between. You will find that the terminal will auto-complete the entire directory-path or name. This comes very handy if the names of the directories are too long and might save you a lot of time.


  2. Many times you will find that you write long commands in the Linux terminal and make a type at the beginning of the command. Now that your cursor is far away from the beginning position and you can’t use the normal mouse pointer to move your cursor inside a terminal, you just start pressing the left arrow key until you reach the starting of the command. This does the work but is quite tedious. What you can do instead is, just press Ctrl + A to move the cursor directly to the beginning of the command.


  3. In a similar situation as mentioned above, if you want to move the cursor to a previous character in the terminal, you can either use the left arrow button or press the Ctrl + B shortcut key.


  4. Suppose you run a command in Linux, and you find that the command just keeps on running and now you want to cancel the execution of that command. To do so, you can press the shortcut key combination Ctrl + C.


  5. To log out of the current terminal session, you can simply use the following shortcut - Ctrl + D.


  6. If you are working with a file and you want to remove the word that you last type, instead of selecting the word with the mouse cursor and pressing delete, you can just use the shortcut key combination Ctrl + W.


  7. If you want to move the typing cursor to one character forward or to the next position, you can use the shortcut key - Ctrl + F.


  8. If you want to search and switch to a command previously used command, you can simply use the key combination - Ctrl + R.


  9. An alternative to backspace that can be used to remove the previous character is Ctrl + H.


  10. If you want to remove a complete line (until the next line break), you can use the following shortcut key combination - Ctrl + U.


  11. If you want to stop all the screens for output, you can use Ctrl + S, and if you want to start them back, you can use Ctrl + Q.


  12. If you want to minimize all the currently opened windows and go back to the desktop screen, you can use the shortcut - Ctrl + Alt + D.


  13. If you wish to log out of the screen or lock/suspend it, you can use the key combination Ctrl + Alt + L.


  14. To open a new window or terminal session, you can use Ctrl + Alt + T.


  15. If you want to switch to a different workspace, you can use the key combinations Ctrl + Alt + Down/Up.


  16. If you are a root user and want to run a command by opening the console, you can use - Alt + F2.

 

Command-Line Shortcuts in Linux

  1. You can use set alias using the ”<alias-name>=<command>“ command to replace long commands and assign short names to them.


  2. If you have scheduled a shutdown and want to cancel it, you can use the command - “shutdown -c”


  3. If you want to shut down the system after a period of time, you can do so using - “shutdown -h 4” which will shut it down after 4 seconds.


  4. You can always use the --help option with any command to find all the options related to it.


  5. If you want to know the path of any file or current working directory, you should use the “pwd” command.


  6. Instead of using the cat command to print file contents in Linux, always use the Less command. It gives better readability.


  7.  You can use the “tree <path-to-file-or-directory>” command to get the entire structure of the directory in a tree format.

 

Wrapping Up

Apart from these, there are tons of shortcuts that might be common for all systems or specific to certain distributions. You can see the set of shortcut keys directory from the GUI and set a few of them as well. Using shortcuts might spare you plenty of time in the long run.

In this article, we discussed a few keyboard shortcuts as well as command-line shortcuts in Linux. We certainly wish that this informative article will help you to use Linux in an efficient way than ever before. 

Antoniy Yushkevych

Master of word when it comes to technology, internet and privacy. I'm also your usual guy that always aims for the best result and takes a skateboard to work. If you need me, you will find me at the office's Counter-Strike championships on Fridays or at a.yushkevych@monovm.com