Linux

Categorized | cli

Use memorized arguments for long commands

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.

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


1 Comment

  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

    1

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>