Ctrl + ago to the start of the command lineCtrl + ego to the end of the command lineCtrl + kdelete from cursor to the end of the command lineCtrl + udelete from cursor to the start of the command lineCtrl + wdelete from cursor to start of word (i.e. delete backwards one word)Ctrl + ypaste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursorCtrl + xxmove between start of command line and current cursor position (and back again)Alt + bmove backward one word (or go to start of word the cursor is currently on)Alt + fmove forward one word (or go to end of word the cursor is currently on)Alt + ddelete to end of word starting at cursor (whole word if cursor is at the beginning of word)Alt + ccapitalize to end of word starting at cursor (whole word if cursor is at the beginning of word)Alt + umake uppercase from cursor to end of wordAlt + lmake lowercase from cursor to end of wordAlt + tswap current word with previousCtrl + fmove forward one characterCtrl + bmove backward one characterCtrl + ddelete character under the cursorCtrl + hdelete character before the cursorCtrl + tswap character under cursor with the previous one
Ctrl + rsearch the history backwardsCtrl + gescape from history searching modeCtrl + pprevious command in history (i.e. walk back through the command history)Ctrl + nnext command in history (i.e. walk forward through the command history)Alt + .use the last word of the previous command
Ctrl + lclear the screenCtrl + sstops the output to the screen (for long running verbose command)Ctrl + qallow output to the screen (if previously stopped using command above)Ctrl + cterminate the commandCtrl + zsuspend/stop the command
!!run last command!blahrun the most recent command that starts with ‘blah’ (e.g.!ls)!blah:pprint out the command that!blahwould run (also adds it as the latest command in the command history)!$the last word of the previous command (same asAlt + .)!$:pprint out the word that !$ would substitute!*the previous command except for the last word (e.g. if you typefind some_file.txt /, then !* would give youfind some_file.txt)!*:pprint out what!*would substitute
/search for a pattern which will take you to the next occurrence.nfor next match in forwardNfor previous match in backward
?search for a pattern which will take you to the previous occurrence.nfor next match in backward directionNfor previous match in forward direction
Ctrl + Fforward one windowCtrl + Bbackward one windowCtrl + Dforward half windowCtrl + Ubackward half window
jnavigate forward by one lineknavigate backward by one line
Ggo to the end of fileggo to the start of fileqorZZexit the less pagerFSimiliar totailf -f
10j10 lines forward10k10 lines backwardCtrl + Gshow the current file name along with line, byte and percentage statistics
vusing the configured editor edit the current filehsummary of less commands&patterndisplay only the matching lines, not all
mamark the current position with the letter ‘a’‘ago to the marked positiona
less file1 file2open two files:e file2open second file- :n – go to the next file.
- :p – go to the previous file.
From Slorks and The Geek Stuff