Find all files with the extension .txt in the home directory and its subdirectories, modified in the last 180 minutes, and replace all occurrences of 'x' with 'y' in those files.
find ~/ -name "*.txt" -mmin -180 -maxdepth 3 | xargs sed -i 's/x/y/g'