DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

Decompress and extract a tgz or tar.gz archive in a single step

Started by qdideas · 9 months ago

Compressed UNIX tar archives (typically tar.gz or .tgz extensions) can be extracted in a single command. This is faster and works with less disk space available.

To extract the compressed tar archive target.tar.gz into the current working directory with:
gzip -dc target.tar.gz | tar ... Continue reading »

2 comments

  • this is easier:

    # tar xvzf target.tar.gz
  • Oh, yeah, I'll admit that command is easier, although back in 2003 it only seemed to work in some linux distros. I was using Solaris (probably 7 at the time) and that tar didn't have that cool option. I don't have a Solaris box handy now, but I would be surprised if that hadn't crept its way in yet.

    Should be noted that 'j' in place of 'z' in your command will extract a bz2 archived tar file. J. Really. I guess all the appropriate letters were on vacation.

Add New Comment

Returning? Login