sed

CLI

Stream editor for filtering and transforming text.

0 views

Installation

Homebrewbrew install gnu-sed

Links

License

GPL-3.0

AI Agent Notes

Stream editor for in-place text substitution

When to use

Simple find-and-replace in files or streams

Examples
  • sed 's/foo/bar/g' file.txt
  • sed -i 's/old/new/g' *.txt

Proven Recipes

Replace string in file (in-place)🟢 95% success
sed -i '' 's/oldtext/newtext/g' file.txt
⚠ Common failures (1)
  • sed: 1: unexpected EOF on macOSmacOS sed requires empty string after -i: sed -i '' ...
Delete lines matching pattern🟢 97% success
sed '/pattern/d' file.txt
Print specific line number🟢 99% success
sed -n '5p' file.txt