Skip to content
The Shell Reliquary

/static/relicario/en/reliquia/circunflexo/

Menu

SHL-007 · Substitution

^velho^novo^

Fixes the previous line by swapping old for new, then runs it.

Got one word wrong in the previous command? A single line of carets swaps the wrong piece for the right one and runs the result. It's the short form of !!:s/old/new/.

It replaces only the first occurrence. For all of them you need the long form with gs: !!:gs/old/new/.

$ ssh estufa.exemplo.org
ssh: connect to host estufa.exemplo.org port 22: Connection refused
$ ^ssh^ping^
ping estufa.exemplo.org
Same line, one piece swapped, run again.