reusing last command argument
$ echo 1
1
$ echo 2
2
$ echo 3
3
$ echo 4
4
$ echo 5
5use 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
!:1gives you the first argument!:2-3gives you 2nd and third argument and!:-3gives 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 3Last updated
Was this helpful?