Skip to content
The Shell Reliquary

/static/relicario/en/reliquia/mod-gs/

Menu

SHL-021 · Modifiers

:gs/a/b/

Swaps every occurrence, not just the first.

The :s for when the wrong piece appears more than once in the line: with the g in front, every occurrence is swapped at once.

It's how you repeat a command with twin arguments — copy a.md to a.bak, then b.md to b.bak — changing both ends together.

$ cp campo-a.md campo-a.bak
$ !!:gs/campo-a/campo-b/
cp campo-b.md campo-b.bak
Both occurrences swapped in a single stroke.