News for hackers. Stuff that matters.
Re:Mastering Bash and Terminal (2017) by klysm on Friday December 10, 2021 @05:25PM (#29516197)
Surprised not to see a mention of “!!” here, I use that a decent amount
Re:Mastering Bash and Terminal (2017) by blockloop on Friday December 10, 2021 @09:21PM (#29517817)
That's one I forgot to mention but I do use it a lot. I don't know if you know this but you can also do a substitution on the previous command. I often do something like `ssh root@proxmox01` and then `!!:s/1/2` which runs it again, but substitutes 1 for 2 and executes `ssh root@proxmox02`.

edit: I realize that example fails the speed test vs `ctrl+p, backspace, 2, enter`, but hopefully you can see the value.

Re:Mastering Bash and Terminal (2017) by sceadu on Saturday December 11, 2021 @01:31AM (#29518969)
could that just be shortened down to ^1^2?
Re:Mastering Bash and Terminal (2017) by Zababa on Friday December 10, 2021 @05:51PM (#29516461)
I use "sudo !!" all the time, it's really useful.