Use memorized arguments for long commands

By | December 2, 2008

You want to apply two different commands on the same file or directory. You don’t have to type the path all over again. Use it like this:

cat /home/user/Downloads/folder1/folder2/file.txt
rm $_

In this case, rm $_ is the same as typing rm /home/user/Downloads/folder1/folder2/file.txt . This can sometimes save you a lot of time.

One thought on “Use memorized arguments for long commands

  1. Jeenu

    I’m sorry the page chopped of all my <alt>!

    In BASH you could do the same with “rm alt-.” and it’ll paste the last argument of the immediately previous command. Further alt-. will insert last arguments from other previous commands. You can also prefix an argument n and it’ll paste the nth argument of the previous command. e.g. alt-3 alt-. will paste the 3rd argument of the previous command

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *