Find all files in the current directory and its subdirectories, and for each file, execute a command to replace the string "bar" with "baz" whenever "foo" is found.
find ./ -type f -exec sed -i '/foo/s/bar/baz/' {} \;