sed Stream editor
Unix tool for text transformations line-by-line via scripts. Lee McMahon, Bell Labs, 1973. sed 's/foo/bar/g' file.txt is the gateway.
Complement to awk (more powerful) and grep (only searches). Regex-based substitution is 99% of all practical use. Multi-line scripts can do fairly complex transformations but Perl/Python is better then. GNU sed has extensions (in-place edit), BSD sed (macOS default) is stricter. Modern alternative: sd (Rust, simpler regex syntax). Classic Unix pipe: cat file | grep pattern | sed 's/x/y/' | sort | uniq.