dailyhack icon indicating copy to clipboard operation
dailyhack copied to clipboard

Get last typed command on terminal

Open FabioRosado opened this issue 5 years ago • 2 comments

You can run the last typed command in the terminal by using !!.

Let's say that your history looks like this:

cd
ls
cd Documents
ls

if you type !! the last command (ls) will be auto-filled in the terminal for you.

But you can also get more specific, by using !<term> so you could use !cd to get the last cd command which was cd Documents

FabioRosado avatar Apr 01 '19 09:04 FabioRosado

Oooo. Love this one. Thanks

cprkrn avatar Apr 11 '19 22:04 cprkrn

Thank you glad you liked this trick 😄

FabioRosado avatar Apr 12 '19 09:04 FabioRosado