shell script find and replace line in file code example
Example 1: ubuntu command line replace word in files
sed -i 's/original/new/g' file.txt
Example 2: replace using sed
#on my mac
sed -i -e 's/old-text/new-text/g' text.txt
sed -i 's/original/new/g' file.txt
#on my mac
sed -i -e 's/old-text/new-text/g' text.txt