Find and Replace Text in a File

Table of Contents

Shell#

Linux#

find . -type f -exec perl -p -i -e 's/Masi/Bond/g' {} \;

Mac#

find . -type f -print0 | xargs -0 perl -p -i -e 's/Masi/Bond/g'

Posix#

sed 's/Masi/Bond/g' FILE > TMPFILE && mv TMPFILE FILE

Explaination#


Linux.Shell - Mac.Shell