Find all files in the current working directory with the extension .txt and execute the command to replace the string "foo" with "bar" in each file.
find $(pwd) -name '*.txt' -exec sed -i s/foo/bar/g '{}' \;