Cycle through the last argument of previous commands in Bash

In Bash, when I want to repeat the last argument of the previous command, I usually type !$. I just discovered that you can also use ALT+. to cycle through the last argument of previous commands.

One Response to “Cycle through the last argument of previous commands in Bash”

  1. matt Says:

    Along those same lines, if you know you typed a command in the past but don’t want to up-arrow or Alt_. you can do Ctrl+r (then type what you’re looking for) to reverse search through the command history. Press Ctrl+r again (while still within the first search) to search back further.

Leave a Reply