These commands will replace all instances of ‘foo’ with ‘bar’ in all files in the current working directory and any sub-directories.

Current Directory:
sed -i s/foo/bar/g *

Recursively:
find * -type f -exec sed -i s/foo/bar/g {} \;

  • Share/Bookmark

Leave a Reply

You must be logged in to post a comment.