In bash, ^foo^bar repeats the latest command, replacing the first instance of 'foo' with 'bar'.
4
19
68
0
0
@UnixToolTip My favorite use is removing "-n" dry-run flags: $ rsync -n -avr … [shows what it would do] $ ^-n [removes the "-n" and actually executes it]
@UnixToolTip It's a really stupid thing to do, you'll run code on live system which hopefully got correctly replaced, without any confirmation. That's how you accidentally all your files.
@UnixToolTip This is a generic feature present in most of shells designed for interactive use, zsh, tcsh and the likes.