Ubuntu – How to recall a command from history by number without executing it

bashcommand linehistory

How can I grab a command from history by number to my command line without executing it?

This immediately executes command number 555 which I'm not looking for:
$ history 10
$ !555

This opens the command up in an editor, which is overkill most of the time:
$ history 10
$ fc 555

This is an example of what I'm looking for:
$ history 10
$ #555
$ [command 555 from history listing now sitting here on my command line ready to edit or execute]

Thank you!

Best Answer

shopt -s histverify

If the histverify shell option is enabled, and Readline is being used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the Readline editing buffer for further modification.