Linux Command Line Shortcuts

Legend ⇧ – Shift
⌥ – Alt
⌃ – Control
⌘ – Command
↵ – Enter


^e – Move to the end of the line

^a – Move to beginning of the line

^r – search through recent history realtime

!# – repeat history command number #

!! – Repeat Last Command

uptime – display system uptime

Alt + b
Move the cursor to the beginning of the current or previous word. Note that while this works in virtual terminals, it may not work in all graphical terminal emulators, because many graphical applications already use this as a menu shortcut by default.
Alt + f
Move the cursor to the end of the next word. Again, like with all shortcuts that use Alt as the modifier, this may not work in all graphical terminal emulators.

Autocomplete commands and file names. Type the first letter(s) of a command, directory or file name, press Tab and the rest is completed automatically! If there are more commands starting with the same letters, the shell completes as much as it can and beeps. If you then press Tab again, it shows you all the alternatives.
This shortcut is really helpful and saves a lot of typing! It even works at the lilo prompt and in some X applications.
Ctrl + u
Erase the current line.
Ctrl + k
Delete the line from the position of the cursor to the end of the line.
Ctrl + w
Delete the word before the cursor.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.