Find all files (type f) in the current directory (.), with a minimum depth of 1 and a maximum depth of 3, with either a .txt or .jpg extension, and execute the sed command to replace the text "text" with "replacement" in each file.
find . -mindepth 1 -maxdepth 3 -type f \( -name "*.txt" -o -name "*.jpg" \) -exec sed -i "s/text/replacement/g" {} +