How to extract tar file to different folder

Only when the the path of files saved in the tar file is relative can you extract them to different folder.
Check it is relative or not using:
tar tvf /paht/your-tar-file.tgz
If the path is relative,
cd  /your/extract/folder
tar xvzf /path/your-tar-file.tgz 
Or just run:
tar xvzf /path/your-tar-file.tgz -C /your/extract/folder
Or
tar xvzf /path/your-tar-file.tgz --directory /your/extract/folder

Featured Post

Updated Coupons / promo codes for Google Apps for Work / Business

To redeem: 1. Sign up for Google Apps   2. Go to your billing settings  3. Choose your payment plan  4. Enter your promo code ...