On linux consoles I always use Alt + . to get the last argument of the previous command in history.
for example if I had
ls /tmp/test
as last command, and if I type
rm Alt -
this will result in
rm /tmp/test
On an Apple terminal, this doesn't work by default but I found an answer here:
Equivalent to alt-. in terminal
You have to change the Terminal’s behavior to the alt key acts as a meta key
Now there is a new problem: I cannot access the pipe | anymore (Alt + 7)
How can I use both?