Showing posts with label directory string replace files. Show all posts
Showing posts with label directory string replace files. Show all posts

Monday, August 6, 2007

Find and Replace string in files under linux directory tree - Linux Shell Script

This is one of most used command in linux to replace the string in files.

find . -name "*.cpp" | xargs grep -l stringtofind | xargs sed -i s/stringtofind/stringtoreplace/