Unix recursive Find and Replace
find spec ! -regex ".*.svn.*" -type f -exec grep -l "it_should_behave_like" {} \; | xargs sed -i "" "s/it_should_behave_like/#it_should_behave_like/"
Explanation:
- find spec find in ./spec folfer
- ! -regex ".*.svn.*" excluding .svn folders
- -type f only files
- -exec grep -l "it_should_behave_like" {} \; extra line to grep only files which contain "it_should_behave_like"
- | xargs sed -i "" pipe to sed editor without creating any backup file (-i)
- "s/ENTER OLD STRING OR TEXT TO REPLACE/ENTER REPLACEMENT STRING OR TEXT/"