shortcut | description |
---|---|
!^ |
first argument |
!$ |
last argument |
!* |
all arguments |
!:2 |
second argument |
!:2-3 |
second to third arguments |
!:2-$ |
second to last arguments |
!:2* |
second to last arguments |
!:2- |
second to next to last arguments |
!:0 |
the command |
!! |
repeat the previous line |
!:- |
whole line except last argument |
!:s/foo/bar |
repeat whole line with substitution |
e.g:
$ echo first second third --fourth
>> first second third --fourth
$ !:0 something-new !:3 !:2 !$ !^
>> something-new third second --fourth first