When running commands, sometimes maybe you need to run a command with the argument from the last command. How can you do this?
Of course, excepting the use of the arrow keys and Del keys: ↑←←←...←→→DelDelDel...Del
For example, if you run this command:
most likely you'd want to go in the recently created directory. You can do this using next "shortcuts":
There are a few shortcuts if you want all of the arguments from the previous command, or just the last argument.
If you want a single argument from a list of arguments from the previous command, you can use
For instance, instead of the countless ↑←←←...←→→DelDelDel...Del you can just press ↑ Ctrl-a(jump to the start of the line) Alt+d(delete to the end of the word)
For more info
To take the
The "screenshot" after you've hit Alt2 is:
You can repeat Alt_ multiple times to get the
Another useful idea is to define alias
something like this !?
in general there are few ways to do this,
use pipe: | (vertical line)