Skip to main content

When running a command on a file, is there anywayany way to reference the file without typing the entire name?

Source Link

When running a command on a file, is there anyway to reference the file without typing the entire name?

For example:

tar xvf test.tar.gz ; rm test.tar.gz 

Is there a faster way to reference the file name on the second execution?

I was thinking something like this (which is invalid):

tar xvf test.tar.gz ; rm $1 

Anything possible?

I'm fully aware of wildcards.