System

Keyboard shortcuts

I’ve been using Linux distribution for some time and along the way I found out few neat little trick that help me work with terminal efficiently.

ShortcutFunction
Ctrl + lClear the terminal screen, similar to clear command.
Ctrl + dClose the shell, similar to exit command.
Ctrl + aMove cursor to the beginning of the line.
Ctrl + eMove cursor to the back end of the command.
Ctrl + uDelete all character before the cursor, similar to BACKSPACE.
Ctrl + kDelete all character after the cursor.
Ctrl + Left / Right ArrowMove cursor to the start and end of the word.
Ctrl + cInterrupt or stop the current running process in the terminal.
Ctrl + zSuspend or pause the current running process in the terminal. Use bg %1 to resume the process.
Ctrl + pSimilar to Up Arrow, go to the previous command in the command history.
Ctrl + nSimilar to Down Arrow, go to the next command in the command history.
Ctrl + rSearch for bash history in reverse, find the desired command, press ENTER ro run it.
Ctrl + gLeave the history searching mode and clear the line.
! +Run the last command that you typed, e.g: !sudo. Careful when using this because you don’t know exactly how the command was executed.
! + + :pAppend :p and bash will print out the command to the terminal without running it. This is useful to confirm that you’ve selected the correct command before running it.