Reusing the last argument is something that I frequently do when working in bash. I’ve more or less committed the !$ history expansion to memory. This makes it really easy to do something like touch myfile.txt and then immediately edit it with vim !$.

I learned about another way to do this using escape-dot today. It works the same way.

It’s nice to learn new stuff but i’ll probably stick with !$ since the keys are pretty close together and make more sense to me with ! indicating history expansion and $ meaning money which is what this shortcut is.

linux  bash