Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

How to pass the 2nd argument to a command from the previous command below ?

# cp ~/longname.txt /really/a/very/long/path/long-filename.txt

Answer

# ls -l !cp:2 ls -l /really/a/very/long/path/long-filename.txt


Question

How to pass the 2nd argument to a command from the previous command below ?

# cp ~/longname.txt /really/a/very/long/path/long-filename.txt

Answer
?

Question

How to pass the 2nd argument to a command from the previous command below ?

# cp ~/longname.txt /really/a/very/long/path/long-filename.txt

Answer

# ls -l !cp:2 ls -l /really/a/very/long/path/long-filename.txt

If you want to change selection, open document below and click on "Move attachment"

15 Examples To Master Linux Command Line History
ommand. In the example below, !cp:2 searches for the previous command in history that starts with cp and takes the second argument of cp and substitutes it for the ls -l command as shown below. <span># cp ~/longname.txt /really/a/very/long/path/long-filename.txt # ls -l !cp:2 ls -l /really/a/very/long/path/long-filename.txt In the example below, !cp:$ searches for the previous command in history that starts with cp and takes the last argument (in this case, which is also the second argument as shown above)

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.