Find all files with the extension .txt in the directory /path/to/dir and replace all occurrences of the word OldWord with the word NewWord.
find /path/to/dir -name '*.txt' | xargs sed -i 's/OldWord/NewWord/g'