Case-insensitive substitution
GNU sed /I flag for case-insensitive match
sed 's/error/ERROR/gI' file.txt
- tool
- sed15 commands
More sed commands
-
sed -e 's/foo/bar/g' -e 's/baz/qux/g' file.txtApply multiple substitutions in one command
-
sed 's/^[[:space:]]*//;s/[[:space:]]*$//' file.txtTrim leading and trailing whitespace from each line
-
sed '5,15s/DEBUG/INFO/g' app.logApply substitution only to lines 5 through 15
-
sed -n 's/^DB_HOST=//p' .envPrint the value of DB_HOST from a .env file
-
sed 's/foo/bar/' file.txtReplace the first occurrence of 'foo' with 'bar' per line