How 2 Know
If you can't Google it, You Can Knowing it.

Recursively replacing a string in all files in a directory

You can use the following command to change Specific string on all files under specific directory:

find /u01/directory -type f | xargs perl -pi~ -e ‘s/oldtext/newtext/g;’

Tested on Linux & AIX

Ref:
https://blogs.oracle.com/rammenon/recursively-replacing-a-string-in-all-files-in-a-directory-linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from How 2 Know

Subscribe now to keep reading and get access to the full archive.

Continue reading