A guide on PySpark Window Functions with Partition By
2022-02-18
Understanding 1D, 2D, and 3D convolutional layers in deep neural networks
2022-02-24
Show all

Useful shortcut keys in Linux terminal

11 mins read

Ubuntu comes with a powerful set of keyboard shortcuts that you can utilize in order to increase your productivity through minimum effort. When you have a good grip on the shortcuts, you can avoid using the mouse; which saves a lot of time. You can also focus more on your work rather than following the mouse pointer. Keyboards shortcuts are especially useful if you do a lot of text editing; your hand muscles will actually thank you for avoiding the mouse. In this article, we will mention many useful keyboard shortcuts for Ubuntu and also show you how to create a custom shortcut for a task that you frequently perform.

Before heading forward with the article, please note the following points:

  • The shortcuts mentioned in this article have been tried and tested on Ubuntu 18.04 (Bionic Beaver).
  • The Super key mentioned in this article refers to the Windows button of your keyboard.

Ubuntu Desktop Shortcuts

You can use the following shortcuts to get the maximum benefit from the Ubuntu desktop environment:

ShortcutUtility
Ctrl+Alt+DeleteUse this shortcut to logout of Ubuntu.
Alt+TabUse this shortcut to switch between open programs.
Ctrl+Alt+TabUse this shortcut to switch between system controls such as Windows, Top Bar, and Desktop.
Ctrl+Alt +EscUse this shortcut to directly switch between system controls.
Super+LUse this shortcut to lock the screen.
Super+AUse this shortcut to view all applications.
Super+VUse this shortcut to view notifications, if any.
Super+SUse this shortcut to get an overview of open activities.
Alt+F1Use this shortcut to get an overview of open windows.
Alt+F2Use this shortcut to open the Run command dialog.
Alt+F4Use this shortcut to close the current window.
Alt +F5Use this shortcut to unmaximize the current window.
Alt+F7Use this shortcut to select the current window for moving.
Alt+F8Use this shortcut to resize the current window.
Alt+F10Use this shortcut to minimize or maximize the current window.
Alt+SpaceUse this shortcut to view the window menu used to maximize, minimize, move, close, etc. the current window.
Ctrl+Super+DUse this shortcut to view the desktop.
Super+PageupUse this shortcut to move to the above workspace.
super+PagedownUse this shortcut to move to the below workspace.
Super+HomeUse this shortcut to move to the first workspace.
Super+EndUse this shortcut to move to the last workspace.
Shift+Super+HomeUse this shortcut to move the window to the first workspace.
Shift+Super+EndUse this shortcut to move the window to the last workspace.
Shift+Super+Up/Shift+Super+DownUse this shortcut to move the window up/down.
Shift+Super+Left/Shift+ Super+RightUse this shortcut to move the window left/right.

Ubuntu Application Shortcuts

You can use the following shortcuts to get the most out of Ubuntu applications:

ShortcutUtility
Ctrl+0Use this shortcut to open a new file.
Ctrl+SUse this shortcut to save the current file.
Ctrl+PUse this shortcut to print the current document.
Ctrl+WUse this shortcut to close the current file.
Ctrl+QUse this shortcut to close the open application.
Ctrl+AUse this shortcut to select all items/text.
Ctrl+CUse this shortcut to copy the selected items/text to the clipboard.
Ctrl+VUse this shortcut to paste the copied items/text.
Ctrl+NUse this shortcut to create a new file in the currently open application.

Ubuntu Screen Printing Shortcuts

You can use the following shortcuts to quickly use the screen printing feature of Ubuntu:

ShortcutUtility
PrintScreenUse this shortcut to take a screenshot of your screen and save it to the Pictures folder.
Alt+PrintScreenUse this shortcut to take a screenshot of the current window and save it to the Pictures folder.
Shift+PrintScreenUse this shortcut to select an area which will be saved as a screenshot in the Pictures folder.
Ctrl+Alt+PrintScreenUse this shortcut to copy a screenshot of a window to the clipboard.
Shift+Ctrl+PrintScreenUse this shortcut to copy a screenshot of a selected area to the clipboard.
Ctrl+PrintScreenUse this shortcut to copy a screenshot of your entire screen to the clipboard.

Ubuntu Terminal Shortcuts

You can use the following shortcuts to run terminal commands quickly in the most optimal manner:

ShortcutUtility
Ctrl+AUse this shortcut to move the cursor to the beginning of the line.
Ctrl+EUse this shortcut to move the cursor to the end of the line.
Ctrl+CUse this shortcut to kill the current process.
Ctrl+RUse this shortcut to search the history based on the entered keywords.
Ctrl+UUse this shortcut to delete the current line.
Ctrl+KUse this shortcut to delete the text at the right side of the cursor.
Ctrl+WUse this shortcut to delete the text before the cursor.
Ctrl+LUse this shortcut to clear the output of a terminal command(s).
Alt+FUse this shortcut to move the cursor forward by one word.
Alt+BUse this shortcut to move the cursor back by one word.
[letter]<tab><tab>Enter a letter and then tab twice to list all the commands beginning with that letter.

For those shortcut key lovers out there, here is a long list of keyboard shortcuts for Ubuntu. Most of them should work in most Gnome-based distros. Enjoy the list.

General Keyboard Shortcuts
Ctrl + ASelect all
Ctrl + CCopy the highlighted content to clipboard
Ctrl + VPaste the clipboard content
Ctrl + NNew (Create a new document or new application, not in terminal)
Ctrl + OOpen file
Ctrl + SSave file
Ctrl + PPrint file
Ctrl + WClose file
Ctrl + QQuit current application
F1Show help/documentation about app/function (if available)
Keyboard Shortcuts for GNOME Desktop
Ctrl + Alt + DeleteLog out
Ctrl + Alt + BackspaceRestart GNOME
Ctrl + Alt + F1Switch to the first virtual terminal
Ctrl + Alt + F2(F3)(F4)(F5)(F6)Select the different virtual terminals
Ctrl + Alt + F7Restore back to the current terminal session with X
Ctrl + Alt + TabSwitch between system controls
Ctrl + Alt + EscapeSwitch system controls directly
Ctrl + Alt + TLaunch terminal
Ctrl + Super + DHide all windows/Show desktop
Alt + TabSwitch between open programs
Alt + SpaceOpen the window menu
Alt + F1Open the Activities overview
Alt + F2Open the “Run a Command” dialog box.
Alt + F4Close the current window
Alt + F5Unmaximizes the current window
Alt + F6Switch windows of an app directly
Alt + F7Move the current window
Alt + F8Resize the current window
Alt + F10Toggle maximization for the current window
Super + AShow all applications
Super + HHide window
Super + LLock the screen
Super + NFocus the active notification
Super + SShow the overview
Super + VShow the notification list
Super + F10Open the application menu
Super + TabSwitch applications
Super + `Switch windows of an application
Super + EscapeRestore the keyboard shortcuts
Super + UpMaximize window
Super + DownRestore window
Super + LeftView split on left
Super + RightView split on right
Super + PageUp/PageDownMove to the workspace above/below
Super + Home/EndMove to the first/last workspace
Super + SpaceSwitch to the next input source
Super + Shift + SpaceSwitch to the previous input source
Super + Shift + Up/Down/Left/RightMove window one monitor up/down/left/right
Super + Shift + PageUp/PageDownMove window one workspace up/down
Super + Shift + Home/EndMove window to first/last workspace
Super + Alt + STurn screen reader on or off
Super + Alt + 8Turn zoom on or off
Super + Alt + =Zoom in
Super + Alt + -Zoom out
Keyboard Shortcuts for Terminal
Arrow Up/DownBrowse command history
F11Full screen
Alt + F/RightMove forward one word
Alt + B/LeftMove backward one word
Alt + (any number from 1 to 0)Switch to respective tab (out of the first ten)
Shift + PageUp / PageDownScroll terminal output
Ctrl + AMove cursor to beginning of line
Ctrl + EMove cursor to end of line
Ctrl + CKill the current process
Ctrl + ZSuspend the current process by sending the signal SIGSTOP
Ctrl + RFind the last command matching the entered letters
Enter a letter, followed by Tab + TabList the available commands beginning with those letters
Ctrl + UDelete the current line
Ctrl + KDelete everything to the right of the cursor’s position
Ctrl + WDelete the word before the cursor
Ctrl + LClears the terminal output
Ctrl + PageUpSwitch to previous tab
Ctrl + PageDownSwitch to next tab
Ctrl + +Zoom In
Ctrl + -Zoom out
Ctrl + 0Normal size (Reset zoom)
Ctrl + Shift + PageUpMove tab to the left
Ctrl + Shift + PageDownMove tab to the right
Ctrl + Shift + CCopy the highlighted command to the clipboard
Ctrl + Shift + V (or Shift + Insert)Paste the contents of the clipboard
Ctrl + Shift + FFind
Ctrl + Shift + GFind next
Ctrl + Shift + HFind previous
Ctrl + Shift + JClear highlight
Ctrl + Shift + TNew hab
Ctrl + Shift + NNew window
Ctrl + Shift + WClose tab
Ctrl + Shift + QClose window
Keyboard Shortcuts for Taking Screenshots
PrintSave a screenshot to Pictures folder
Alt + PrintSave a screenshot of a window to Pictures folder
Shift + PrintSave a screenshot of an area to Pictures folder
Ctrl + Alt + PrintCopy a screenshot of a window to clipboard
Ctrl + Shift + PrintCopy a screenshot of an area to clipboard
Ctrl + PrintCopy a screenshot to clipboard
Ctrl + Shift + Alt + RStart screencast recording
Keyboard Shortcut for Files/Nautilus
DeleteMove selected files/folders to Trash
Shift + DeleteDelete selected files/folders permanently
Ctrl + ?/F1Open the Keyboard Shortcut window
Ctrl + TOpen a new tab
Ctrl + PageUpGo to previous tab
Ctrl + PageDownGo to next tab
Ctrl + Shift + PageUpMove tab left
Ctrl + Shift + PageDownMove tab right
Ctrl + Shift + TRestore closed tab
Alt + 0 … . 8Go to the specified tab
Ctrl + Shift + NCreate new folder
Ctrl + Shift + IInvert selection
Ctrl + ENTEROpen the selected folder in a new tab
Shift + ENTEROpen the selected folder in a new window
Ctrl + I or Alt + ENTERShow file/folder properties
Ctrl + 1Toggle view as list
Ctrl + 2Toggle view as grid
Ctrl + SSelect pattern
Ctrl + ASelect all files and folders
Ctrl + FSearch
Ctrl + DBookmark current location
Ctrl + ZUndo
Ctrl + Shift + ZRedo
Ctrl + WClose window
Ctrl + O or EnterOpen selected file/folder (with default application)
Ctrl + Shift + DownOpen file and close window
Ctrl + RReload window
Alt + UpGo up
Alt + LeftGo back
Alt + RightGo forward
Alt + DownGo down
Alt + HomeGo to Home folder
Ctrl + LShow/go to location bar
Ctrl + Alt + OOpen item location (search and recent only)
/Show/go to location bar with root location
~Show/go to location bar with Home location
Ctrl + HShow/hide hidden files
Ctrl + +Zoom in
Ctrl + -Zoom out
Ctrl + 0Reset zoom
Alt + DownOpen selected file with default application
F2Rename selected file/folder
F5 or Ctrl + RRefresh view
F9Show/hide sidepane
F10Show/hide action menu

1. Ctrl + Shift + N => New terminal window 
This shortcut can be used to open a new terminal window. For this to work, you should already be on the terminal window. 

2. Ctrl + Shift + T => New terminal tab 
If you use the above combination, you can open the terminal tab in the same window. 

3. Ctrl + C or Ctrl + Z => Kill the current process 
If you are running any application through the terminal, you can kill it by using the above combination. 

4. Ctrl + R => Reverse search 
If you are working in the IT industry or you are a college student, many times the same command repeats. To search previously entered commands, we can use the above combination. 

5. Ctrl + U => Delete line 
This shortcut will delete the whole line before the cursor. 

6. Ctrl + W => Delete the word 
This shortcut will delete the whole word before the cursor. 

7. Ctrl + K => Delete the word 
This shortcut will delete the whole line after the cursor. 

8. Ctrl + Y => Undo erased content 
If you have mistakenly deleted some content using Ctrl + UCtrl + W or Ctrl + K and now you want to undo the change. You can do so by using the above combination. 

9. Ctrl + L => Clear console 
This is similar to the clear command used to clear the console. 

10. Ctrl + Shift + C => Copy 
This shortcut is used to copy the selected content. 

11. Ctrl + Shift + V => Paste the content from the clipboard 
This shortcut is used to paste the content copied on the clipboard. 

12. Alt + F => Move forward 
This combination is used to move one word forward. Alternatively, we can use the Ctrl + right arrow to do so. 

13. Alt + B => Move one word backward 
This combination is used to move one word backward. Alternatively, we can use the Ctrl + left arrow to do so. 

14. Arrow Up / Down => Browse commands 
To go through the previously executed commands, we can use up or down arrow keys. 

15. Alt + D => Delete line 
This is similar to the Ctrl + U, except it removes the line after the cursor. 

16. Shift + PgUp/PgDn => Scroll through console 
We can use the above combination to scroll up or scroll down through the console. 

17. Ctrl + PgUp => Switch to left tab 
We have seen we can use the Ctrl + Shift + T to open a new terminal tab. To move to the left tab, we can use the above shortcut. 

18. Ctrl + PgDn => Switch to right tab 
Similarly, we can use the above shortcut to move to the right tab. 

19. Ctrl + Shift + PgUp => Move current tab to left 
We can use the above shortcut to move the current tab to left. 

20. Ctrl + Shift + PgDn => Move current tab to right 
We can use the above shortcut to move the current tab to right. 

21. Ctrl + D => Close terminal 
This combination is used to close the current tab. If there is only one tab, it’ll close the terminal window. 

22. Ctrl + P => Previous executed command 
We can go through the previously executed sequence of commands using the above shortcut. 

23. Ctrl + N => Next executed command 
We can go through the next executed sequence of commands using the above shortcut. 

24. Ctrl + J => Enter 

25. Ctrl + Alt + T => Open terminal 

26. Ctrl + Shift + Q => Close all 
This will close all tabs on the current terminal window. This will not close the other open terminal windows. 

27. Super + RowUp => Maximize 
This is used to maximize the terminal window. 

28. Super + RowDown => Minimize 
This is used to minimize the terminal window. 

29. Ctrl + Shift + F => Find 
Similar to Ctrl + F on any text editor, we can use the above shortcut to find through the terminal console. 

30. Alt + C => Capitalizes the word next to the cursor and move to end of the word 
For Example: Suppose a word hangout and cursor is before hangout, the above shortcut will capitalize ‘h’ of hangout and go to the end of the word. 

31. Use of Tab => To get suggestions 
We can enter a partial initial command such as MySQL, and we’ll get a list of the commands that start with MySQL. 

How to Create a Custom Shortcut on Ubuntu 18.04

If you find yourself in a situation where you have to perform a task, again and again, Ubuntu enables you to create a custom shortcut for it. Lets us present an example of how to create a custom shortcut in order to launch the graphical text editor gedit on Ubuntu.

  1. Open the Settings from Ubuntu dash or the down-arrow button located at the top right corner of your screen.
  2. Click the Devices tab from the left menu of the Settings window.
  3. Click the KeyBoard tab from the Devices menu. The following Keyboard view will be displayed in the right panel:
Create Ubuntu Keyboard Shortcut

Scroll down the right panel and click the + button. The Add Custom Shortcut dialog will appear.

Add the following information in the Add Custom Dialog menu:

  • Name: Launch gedit
  • Command: gedit
  • Shortcut: Set a shortcut by pressing the “Set Shortcut” button and then setting a shortcut by pressing both keys simultaneously. This shortcut should not be already in use.
Set Custom Shortcut

This custom shortcut is now set and you will be able to launch gedit anytime you press the new custom shortcut.

References:

https://www.maketecheasier.com/useful-shortcut-keys-in-ubuntu/

https://www.geeksforgeeks.org/keyboard-shortcuts-for-ubuntu-set-1/

vitux.com/the-powerful-world-of-ubuntu-keyboard-shortcuts/

Amir Masoud Sefidian
Amir Masoud Sefidian
Machine Learning Engineer

Comments are closed.