How-To Geek
Save Typing by Reusing All Arguments of the Previous Linux Command
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:
cat /home/geek/documents/testfiles/testfile1
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:
vi !*
This would be expanded out to:
viĀ /home/geek/documents/testfiles/testfile1
Saves some typing, and just a useful command to know.
|
Subscribe |
Daily Email Updates |
|
You can get our how-to articles in your inbox each day for free. Just enter your email below: |
- By The Geek on 07/28/10

Comments are closed on this post.
If you'd like to continue the discussion on this topic, you can do so at our forum.
Go to the Forum