This question already has an answer here:
tar.gz file gets uncompressed with all contents to arbitrary directory, existing or not using tar using single line command? If it does not exists, then is created (directory). To clarify, let consider example:
archive-latest.tar.gz from internet into directory
/home/user/Downloads. I have microSD card target partition mounted on
/mnt/archive. Once downloaded, I want to extract downloaded
/home/user/Downloads/archive-latest.tar.gz directly on
/mnt/archive using single line command. I've read
man tar manual, but I cannot find option for specifying target dir.