Quickly replace strings in many/all files

This is mainly a note to self, maybe it helps someone else. Here’s a one-liner to replace a string in a lot of files at once:

Replace replaceFrom with replaceTo in all writable files in the current directory, recursively:

find . -type f -writable -print0 | xargs -0 sed -i 's/replaceFrom/replaceTo/g'

Leave a Reply

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