I sometimes end up doing things like:
$ mkdir ~/test-tmp $ cp * ~/test-tmp $ cd ~/test-tmp
using the destination dir 3 times in a row. Isn't there a way to turn these into a one-liner command?
You mean like this?
If your concern includes the retyping of
Please note that if your path includes spaces, you have to quote the assignment and where you use the variable:
In bash, the argument to the last command you ran is saved as
So, you could do