Bash shortcuts source
Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – move between start of command line and current cursor position (and back again)
Ctrl + r – search the history backwards
and dont forget good old ^^. ^x^y = run last command but replace 'x' with 'y'
fc - load last command in Vim - allowing you to edit it and then rerun it.
ReplyDeletebind '"\e[A": history-search-backward'
ReplyDeletebind '"\e[B": history-search-forward'
/\ changes up and down to search thru your shell history
Reddit link
ReplyDeletehttp://www.reddit.com/r/linux/comments/mi80x/give_me_that_one_command_you_wish_you_knew_years/
ESC - b and ESC - f to move cursor forward/backward by word
ReplyDeleteALT-. (dot key) - walk back thru list of previous aguments.
ReplyDeleteALT-NUMBER CTRL-ALT-Y - duplicate the NUMBER param (0 is the command)
!:NUMBER - duplicate the NUMBER param (0 is the command)
Delete