Find all files with the extension ".dat" in the current directory and its subdirectories, and compress them into an archive file called "archive.tgz".
find ~ -name '*.dat' | xargs tar -cvzf archive.tgz