ManticMoo.COM -> Jeff's Articles -> Programming Articles -> How to gunzip and untar all at once!

How to gunzip and untar all at once!

by Jeffrey P. Bigham

This tip is a rather simple but useful one. It's not a trick or anything fancy, but just something that I somehow didn't know for a long time that I wish I would have. A common thing to do in Linux/Unix/Whateverix is to download a tarball archive that has been gzipped and then extract and untar it. So you might do somethig like this:


gunzip myfile.tar.gz
tar -xvf myfile.tar

The first command unzips it. The second command extracts the tar archive. What I didn't know is that you can combine all of this into one simple command! Just do the following:


tar -zxvf myfile.tar.gz

That's all there is to it!

ManticMoo.COM -> Jeff's Articles -> Programming Articles -> How to gunzip and untar all at once!