Just a question to improve my bash skills. I always do this:
$ history | grep some_long_command
...
...
123 some_long_command1.........
124 some_l
Actually, you can just append :p to the command to print it without actually running it. For example:
$ ls -la
$ !!:p
Will print out ls -la as the previous command without running it, and you can just press ↑ (up) to find it and edit it.
You can also do
!123:p
to print out the 123rd command as your previous command.