Case-insensitive substitution sed
GNU sed /I flag for case-insensitive match
sed 's/error/ERROR/gI' file.txt
more sed
all 15 commands →
Multiple expressions
sed -e 's/foo/bar/g' -e 's/baz/qux/g' file.txt
Strip leading/trailing whitespace
sed 's/^[[:space:]]*//;s/[[:space:]]*$//' file.txt
Address range substitution
sed '5,15s/DEBUG/INFO/g' app.log
Extract value from key=value file
sed -n 's/^DB_HOST=//p' .env
Substitute first match per line
sed 's/foo/bar/' file.txt