Thursday, October 6, 2011

Search and replace a string, recursively..... under linux

Under linux.....

sed -i 's/stringA/stringB/g' *
 
replace stringA with stringB in all files under current directory....
Recursively way.....
find ./ -type f -exec sed -i 's/stringA/stringB/g' '{}' \; 
 
Bye... 

No comments:

Post a Comment