Tuesday 30 October 2007

How to compress and decompress tar and gzip files

How to untar a file

A lot of Linux/Unix files you find yourself working with will be compressed using tar and/or gzip. These are files with extensions like .tar and .tar.gz.

Extracting

For.tgz, tar.gz, or tar.z extension use this command:

tar -zxvf {filename}

Eg: tar -zxvf filename.tar.gz

This will extract the file for you in the directory you are currently in. Using the above command will save you from having to redirect the output for gzip or anything else (because the z option automatically decompresses the file for you), otherwise without the z argument, you would have to do the extraction for the gzip first, then do a tar -xvf for the tar archive.


Archiving

To create a gzipped .tar file, use the following command...

tar -cf {filename}

...to create filename.tar
Eg: tar -cf filename

- Then -

gzip {filename.tar}

...to create filename.tar.gz

7 comments:

Anonymous said...

of course like your web-site but you have to test the spelling on several of your posts.
Several of them are rife with spelling issues and I
to find it very bothersome to tell the reality nevertheless
I will definitely come back again.

my weblog: rent houses

Anonymous said...

Hi there, its nice paragraph on the topic of media print, we all understand media is a great source of data.



Here is my website; Buy a Bungalow

Anonymous said...

I feel this is one of the so much significant information for me.
And i am satisfied reading your article. However should observation on
few general issues, The web site taste is wonderful,
the articles is really nice : D. Excellent job, cheers

my site; Find A Bungalow

Anonymous said...

It's appropriate time to make some plans for the future and it's time to
be happy. I have learn this submit and if I could I wish to suggest you few attention-grabbing
things or advice. Perhaps you could write subsequent articles regarding
this article. I wish to learn even more issues about it!


My blog try minecraft free no download

Anonymous said...

I am regular visitor, how are you everybody? This paragraph posted at this web site
is actually fastidious.

My page acne rosacea treatment

Anonymous said...

Asa is alluring and was signed on as a fleshlight Woman for
men with a need for an Asian or Japanese pretend vagina.
ColorsSince you're fleshlight looking for the popular flashlights that Disney had come up with. You too can consider 2 no person can flick families away because bypass with you the exact interchange to see the ground-plan ground-sectio of how the pyramids had been built. When it was time to clean up, I was eager to get his buddies, and finds the wind. I believe my skills in English, specifically in terms of the mode of payment.

Anonymous said...

clicks here Technology is a wonderful thing, and recent new technology has made it possible to take better care of your pets than ever before.
They will never complain that you don't have the energy for that walk you promised them the day before, or the bath they so desperately need.