Search the root directory and its subdirectories up to two levels deep for any files with the ".txt" extension and replace the word "test" with "test2" in each of those files.
find / -maxdepth 2 -type f -name "*.txt" -exec sed 's/test/test2/g' {} \;