Find all files with the extension .txt in any subdirectories between two and four levels deep and replace the word "hello" with "world" in each of them.
find . -mindepth 2 -maxdepth 4 -type f -name '*.txt' -exec sed -i 's/hello/world/' {} \;