3 ms·
If you don't want to rely on the "histverify" option being enabled, you can get a similar effect by appending ":p" to the history reference, e.g. sudo !!:p
by teraflop 10y ago
If you don't want to rely on the "histverify" option being enabled, you can get a similar effect by appending ":p" to the history reference, e.g.
sudo !!:p
which tells bash to do the history expansion, but print the result and add it to the command line history, instead of actually running it. If the command looks correct, it's only two more keystrokes (up-arrow, enter) to run it for real.
- Natanael_L 10y agoThat feels dangerous. For example, on Swedish keyboards the character ; is one key away from :