sed replace character in file code example
Example 1: sed replace in file
sed -i 's/foo/bar/g' hello.txt
Example 2: replace using sed
#on my mac
sed -i -e 's/old-text/new-text/g' text.txt
sed -i 's/foo/bar/g' hello.txt
#on my mac
sed -i -e 's/old-text/new-text/g' text.txt