I'm trying to use sed to edit a config file. There are a few lines I'd like to change. I know that under Linux sed -i
allows for in place edits but it requires you save to a backup file. However I would like to avoid having multiple backup files and make all my in place changes at once.
Is there a way to do so with sed -i
or is there a better alternative?
a
are turned intob
, and then all instances ofb
are turned intod
. You could do the same thing withsed -i -e 's/a\|b/d/g' file
—turn all instances of eithera
orb
intod
. – Wildcard Mar 11 '16 at 01:53sed -i '' -e
– zinking Feb 16 '22 at 07:39