Reusing last command arguments
2016-03-11 ::
( 1 minutes reading )
|
|
use alt + .
will reuse the last program argument in descending order
$ echo (press alt + .)
$ echo 5 (press alt + . again)
$ echo 4 (press alt + . again)
...
selective arguments
!:1
gives you the first argument!:2-3
gives you 2nd and third argument and!:-3
gives you binary name + first 3 arguments
$ echo 1 2 3 4 5
$ echo !:1 # -> echo 1
$ echo 1 2 3 4 5
$ echo !:2-3 # -> echo 2 3
$ echo 1 2 3 4 5
$ echo !:-3 # -> echo echo 1 2 3
comments powered by Disqus