Search and replace in multiple files

July 23, 2010 by
Filed under: Notes 

Thanks to this site

for fl in *.txt; do
mv $fl $fl.old
sed ’s/FINDSTRING/REPLACESTRING/g’ $fl.old > $fl
#rm -f $fl.old
done

Comments

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!