i have more than 1000 files and want to replace a special text in all of them with another phrase.
how can i do it by shell script in linux?
sed -i 's/old-word/new-word/g' *.txt
http://www.cyberciti.biz/faq/unix-linux-replace-string-words-in-many-files/
Something like this:
for file in *.txt
do
cp $file $file.tmp
cat $file.tmp | sed 's/foo/bar/g' > $file
done
-i to edit the files in place, so there is neither a need for a temporary file nor for a loop.