You can also get at the arguments of the previous command line with !!:n, where n is the position of the argument.
i.e.
host:test user$ touch one two three four five
host:test user$ ls
five four one three two
host:test user$ cat four
host:test user$ echo !!:1
echo four
four
Also, "Esc, dot" is an awesome bash shortcut. (Press them consecutively, not concurrently). It inserts the last argument of the previous command in place. So if you're doing something to the same file, Esc, . will usually bring up the file name.
i.e.
host:test user$ cat five
host:test user$ touch [Esc, .]
i.e.
Also, "Esc, dot" is an awesome bash shortcut. (Press them consecutively, not concurrently). It inserts the last argument of the previous command in place. So if you're doing something to the same file, Esc, . will usually bring up the file name.i.e.