Find all files with the extension ".txt" in the current directory and its subdirectories, and replace the second occurrence of the word "dog" with the word "cat" in each file.
find . -type f -iname "*.txt" | xargs sed -i 's/dog/cat/2'