Linux Terminal Shortcuts

Linux Terminal Shortcuts

Using Linux and working in the command-line gets a deeper knowledge in computers if the right commands are used. A terminal in Linux provides all sorts of activities like editing text files, Wi-fi connection, network management, installing, updating, and deleting files. All these commands are easy to use and time-saving.

Linux supports lots of command-line shortcuts. There are multiple keyboard shortcuts to use all the commands which are time saving commands.

For example, the up and down arrows keys on the keyboard to cycle through previous commands. Or  Tab key to complete partial commands and even file and directory names.

Similarly use following keyboard shortcuts to save your time.

1. Move cursor

Use Ctrl + Left and Ctrl + Right to move between the various parts of the line. Let’s say you’ve typed out the following line.

lenovo@jags:~$ sudo apt-get install gksu

Tapping Ctrl + Left moves to the beginning of sudo, apt, get, install, and gksu, in that order and similarly, Ctrl + right moves the cursor to the end of each command.

2. Beginning or End of a command

Home or Ctrl + A moves the cursor to the beginning of the line. End or Ctrl + E moves you back to the end.

lenovo@jags:~$ sudo apt-get install gksu

Tapping Ctrl + A moves to the beginning at sudo apt-get install gksu and similarly, Ctrl + E moves the cursor to the end of sudo apt-get install gksu.

3. Erasing commands

  • Ctrl + K to remove all of the commands at once.
  • Ctrl + W to remove each word from the command

4. Copy the previous command

lenovo@jags:~$ sudo !! : It copies the previous command that is executed.

5. Return to the Home Directory

lenovo@jags:~$cd -  Navigate to home directory.

6. Copy the previous line using the same command

If multiple commands are executed and you want to copy the line with some specific command then this code can be done.

lenovo@jags:~$! ls  - This code will show the lines that start with ls

7. Clear Terminals

Instead of writing clear just Ctrl + l will clear the terminal screen.

8. Check Manual Page of command

lenovo@jags:~$man sudo

9. Show all the command used

lenovo@jags:~$ history
Share this on facebook

Subscribe to our Youtube Channel

Leave a comment

Your email address will not be published. Required fields are marked *