Uncompressing tgz files

From Attie's Wiki
Jump to: navigation, search

You'll often find that if you download a file, either the source code, or the executable itself (The Binary), it's followed by a .tgz suffix. This means that the file has first been tarred (The t part of the suffix), which means that all the files for this particular download were put into one big file. This is akin to taking a few episodes of startrek on separate tapes, and copying them onto one cassette. All the originals are there, you just need to fast forward or rewind the tape to get to the right place for the one you want. The ironic thing, is that the program tar that was used to create the archive can actually spool through a backup cassette too ( And you think all my analogies are meaningless ;).

The other part of the suffix is gz. This means that the tar archive was compressed using gzip. The nice thing is that for uncompressing the original files, you dont have to run decompress itfirst, and then untar it. Both can be executed with a simple command.

To decompress

tar zxvf <filename>.tgz - If a folder was compressed originally, then the original folder will be created. If not, then the files will be placed in the current directory
tar xvf <filename>.tar - If the tar is not compressed
tar xjvf <filename>.tar.bz2 - If a folder is a .bz2 type

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox