Find and replace a string in all the files recursively
Below are some useful commands to find and replace a string in all the files recursively in unix:find . -type f|xargs perl -pi -e 's/source/target/g'
or
find . -type f -exec perl -pi -e 's/source/target/g' {} \;
or
find . -type f -exec sed -i 's/source/target/g' {} \;
All the three are logically similar
.png)







I am a software programmer working in India. I usually like to blog in my free time.
0 comments: