command tar and gzip

cangyin

New Member
Joined
Apr 3, 2019
Messages
5
Reaction score
3
Credits
0
Hello!
I am a little confused at the 'UnTar' part. Say I have a tarball file ‘mytarball.tar.gz’.
As how I understand the process, I created the tarball with tar command first, then gzip tool. Should I untar the tarball and then gunzip it, or gunzip it first and then use the untar command?
Thanks!
 


Hi @cangyin

Here's something from our beginner tutorials:
https://www.linux.org/threads/file-backup-tar-gzip.4132/

Short answer though: i've always just used tar with the appropriate flags to archive or unpack the files.. unless of course it's just a .gz file.

file.tar.gz: i'd use 'tar zxvf file.tar.gz'
file.tar: i'd use 'tar xvf file.tar'
file.tgz: (same as file.tar.gz), i'd use 'tar zxvf file.tar.gz'
file.gz: i'd have to use 'gunzip file.gz'
 

Members online


Latest posts

Top