Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

":, @: ": is the register storing the last executed command. You can write ":p to print it to the buffer. @: reruns the last command.

That seems like a mouthful. I use :<up arrow> to run the last command and <up arrow> some more to run the ones before that.



And if you wanted to repeat that 10 times you would...?



Press up ten times. That's still what a lot of us do in terminal (particularly when we're on a machine without fancy shell history fuzzy-searching etc.).

I guess I might press and hold at ten.


Your machine probably has ^r for working through bash history

But that aside, if you’re into arrow pressing, a few lines in your .inputrc can go a long ways

Test this out sometime:

  # Incremental searching with Up and Down and Left and Right
  "\e[A": history-search-backward
  "\e[B": history-search-forward
Now you can type “find” and press up/down arrow to just cycle through history that starts with find


Personally, I would do 9@@ after the first @:


You can also use `:^F` to navigate your history in a horizontal split using regular motion/search keys.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: