Find all files (not directories) in the current directory and its subdirectories, that do not have a ".txt" extension, and replace all occurrences of "foo" with "bar" in those files.
find ~ -type f ! -name '*.txt' | xargs sed -i -e 's/foo/bar/g'