Tag: replace in files
Search in files and replace by bash
by z3n on Oct.26, 2009, under Coding, Linux Happyness, Tips & Hints
Problem:
How to change a string on several files by bash without opening one by one.
Solution:
for i in $(find . -type f); do sed ’s/find/replace/g’ $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done
Yes, it’s just a copy paste from the source, i don’t have time to explain each command.
Source: