Tuesday, 7 April 2020

Linux terminal shotcuts

Hi,

Here are some Linux terminal shortcuts that should know.

1. Ctrl + A

it'll move the cursor to the beginning of the line.

For instance, you've typed a long command and want to edit the beginning. Here where Ctrl + A. comes into the picture.

2.  Ctrl + E

Opposite to the Ctrl + A
where Ctrl + E moves the cursor to the end of the line.

3.  Ctrl + L

This is the same as clear command.

4. Ctrl + D

This one will log you out of the current terminal.
For instance, if  you are in root or some other user and want to switch back to normal user, user Ctrl+D
<monu@linux:~> logout (Ctrd + D)
[root@linux ~]$


5. Ctrl + C

If you want to stop the current command or process you can use Ctrl + C.

<monu@linux:~> ls -lth ^C
<monu@linux:~>


6. Ctrl + Z

This will send the current running program into the background. Usually, you can achieve this by appending the ampersand(&) at the end of the command(e.g: bash file.sh &). If you forgot to do this use Ctrl+Z

7. Ctrl + U

This will erase everything from the current position to the beginning of the line.

8. Ctrl + W

If you want to delete a single word, use Ctrl + W

9. Ctrl + Y

This will paste the erased text that you saw in Ctr+W and Ctrl+U

10. Ctrl + P

To view the previous command.