Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I want to unpack a .tar.gz file to a specific directory.
The archive file is in /root/Documents. I want to unzip it into /root/Desktop/folder. The folder structure in zipped file should be preserved in the destination directory.
You have two choices:
tar xf /root/Documents/file.tar.gz
tar xf file.tar.gz -C /root/Desktop/folder
gzip -dc archive.tar.gz | tar -xf - -C /destination
tar -xvjf foo.tar.bz2
Required, but never shown
7 years, 3 months ago
2 years, 3 months ago