Tuesday, December 6, 2011

bash commands shortcuts

http://www.gnu.org/software/bash/manual/bashref.html#Commands-For-History

yank-nth-arg (M-C-y)
alt+ctrl+y

Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument n, insert the nth word from the previous command (the words in the previous command begin with word 0). A negative argument inserts the nth word from the end of the previous command. Once the argument n is computed, the argument is extracted as if the ‘!n’ history expansion had been specified.

yank-last-arg (M-. or M-_)

alt+-
Insert last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like yank-nth-arg. Successive calls to yank-last-arg move back through the history list, inserting the last argument of each line in turn. The history expansion facilities are used to extract the last argument, as if the ‘!$’ history expansion had been specified.





No comments: