Find all files with the extension ".txt" in the current directory and its subdirectories, then copy each of them to the /tmp directory with the same name.
find ~ -name "*.txt" | xargs -I{} cp {} /tmp/{}