You might want to reuse all of the arguments to a previous command in the shell if you realized you want to open the file with a different utility, but don’t feel like typing out the whole path again.
For instance, say you ran a cat on a file deep within a folder structure, like this:
If you want to open that file up in vi, you don’t have to retype the whole command (or hit the up key and edit the command). Just type in the following:
This would be expanded out to:
Saves some typing, and just a useful command to know.
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 07/28/10