4 ms·
!! (bang-bang) is expanded by the shell before its committed to your history (at least in bash), so if you hit ctrl+p, you'll get the full sudo command for runn
by jonhohle 16y ago
!! (bang-bang) is expanded by the shell before its committed to your history (at least in bash), so if you hit ctrl+p, you'll get the full sudo command for running/modifying later.
- tjarratt 16y agoIn zsh, !! is expanded by the shell, but leaves the expanded command at the terminal, waiting for you to execute it. Most of the time this means I have to hit enter twice to run the command, but it's convenient when I want to explain to someone what !! is useful for.
- vsync 16y agoI don't have that enabled but zsh also expands bang constructs with tab. So any commands I want to double check, or if I am demonstrating to someone, I just hit tab. Also handy for expressions like !-2:3 where if I messed up I can just hit "undo" and then retry.
- zacharypinter 16y agoAh. Good to know.