for f in * do sed 's/string1/string2/g' $f > $f.new && mv $f.new $f done