Skip to content

Instantly share code, notes, and snippets.

View donat's full-sized avatar

Donát Csikós donat

View GitHub Profile
# This file operates on every file within the current directory and below, recursively.
# The original command is from http://rushi.vishavadia.com/blog/find-replace-across-multiple-files-in-linux
# but has been modified to not mess with end of line characters (-b option in sed) according to http://stackoverflow.com/a/11508669
find . -name "*.html" -print | xargs sed -i -b 's/find/replacewith/g'
# This example command searches only .html files. This can be changed to anything.
# You need to specify what to find and what to replace it with (find/replacewith). These are regular expressions, so be careful of special characters.