Search multiple files in multiple directories using find.
find /usr /opt \( -name fileName1 -o -name fileName2 \) -print
Search for fileName1, fileName2 in /usr /opt diretories.
Search and replace a foo with bar in all xml files in a specific directory
for i in `find /directory/Files -name '*.xml' `
do
echo "Changing $i file "
sed 's/foo/bar/g' $i > tmp.xml && mv tmp.txt $i
done
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment