Published on

Stream edit files with sed

Authors
  • Mehdi Akiki avatar
    Name
    Mehdi Akiki
    Twitter

Replace text (inline with backup):

sed -i.bak 's/old/new/g' file.txt

Use -r or -E for extended regex and sed -n to suppress default printing.

Tip: ed/ex can be easier for scripted in-place edits on macOS where sed differs.

I build and scale reliable production systems. Open to full-time and freelance work with U.S.-based teams that value ownership and execution.

Got something in mind?

Book a Discovery Call