ramblings of an administrator
Archive for August, 2010
Find and replace across multiple files
3August 13, 2010
I needed to quickly modify 500 hundred XML files, each was about 10MB in size, thankfully Linux makes that pretty fast and very easy.
find . -name "*.xml" -print | xargs sed -i 's/FROM/TO/g'
A semi "real world" example:
find . -name "*.xml" -print | xargs sed -i 's/foo/bar/g'

