Pressing ESC and then _ will insert the last argument of the last line. Repeat to go up in the history.
If you go through the command history and press CTRL-o on a line it will be executed and the command on the commandline will be replaced by the next line in the history.
!$ runs the last command. it's bad if the last command is of the form command arg... because it'd run command without every other argument passed in the command line
Also M-. (meta-period). Keep banging on M-. to pull in the last argument of preceding commands.
With a numeric prefix argument N, it grabs the Nth-from-the-end argument of the previous command, so M-3 M-. grabs the 3rd-from-last argument from the previous command.
If you go through the command history and press CTRL-o on a line it will be executed and the command on the commandline will be replaced by the next line in the history.
With a numeric prefix argument N, it grabs the Nth-from-the-end argument of the previous command, so M-3 M-. grabs the 3rd-from-last argument from the previous command.