All HowTo's

Find and Replace in multiple directories

This article explains how to search for files with a string and replace that string with another string.

cd /home
find ./ -type f -exec sed -i -e 's/FromThis/ToThis/g' {} \;

The above will search through the /home directories and replace any occurrence in any file of “FromThis” with “ToThis”.

Leave a Reply

Your email address will not be published. Required fields are marked *