Find and replace text (patterns) within a text file in terminal
Post date: Aug 14, 2014 7:41:55 AM
Here is example to replace 'original' with 'new' in a text file called file.txt
:
sed -i 's/original/new/g' file.txt
Note that -i means 'in-place'
good tutorial:
http://askubuntu.com/questions/20414/find-and-replace-text-within-a-file-using-commands