Commands.app

sed

Text Processing

Stream editor for filtering and transforming text

Options & Flags
Available options for this command
-i

Edit files in-place

-e

Add script to commands to be executed

-n

Suppress automatic printing

Examples
Common usage examples

Replace first occurrence of 'old' with 'new' on each line

sed 's/old/new/' file.txt

Replace all occurrences of 'old' with 'new'

sed 's/old/new/g' file.txt

Replace in file (in-place edit)

sed -i 's/old/new/g' file.txt
Related Commands
You might also find these useful