Find all files with the extension ".txt" in the current directory and its subdirectories, up to a maximum depth of 2, and compress them using gzip.
find ~ -maxdepth 2 -type f -name "*.txt" -exec gzip {} \;