LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tar/Zip Files and Such (https://www.linuxquestions.org/questions/linux-newbie-8/tar-zip-files-and-such-133483/)

Godboo 01-10-2004 04:14 PM

Tar/Zip Files and Such
 
Hey Guys,

Just wondering what is the difference between tar, and zip/gunzip/bzip?

Also, if a file haz an extension ***.tar.gz, how would you uncompress it at the shell?


Thx for any feedback.

slakmagik 01-10-2004 04:16 PM

The search button is your friend.

Tar is originally based on 'tape archiving' - still does that, but it's mainly used to bundle up many files into one. zip, gzip, and bzip are all compression utilities, using different algorithms. So a *.tar.gz is a file that has been gzipped and tarred. To extract it,

tar -xzf file

If it's been bzipped, it's

tar -xjf file

If it's been zipped, I usually do 'unzip file'. :)

Man tar (and all the rest for more details.)

-- Actually, to be a little more precise, bzip is a better algorithm - compresses more - but takes longer to compress and extract. gzip is pretty good and faster. But, on most processors, .005 seconds and .007 seconds isn't much to get excited about. Then again, with today's hard drives and DSL, 250k and 230k (I'm making up numbers - I'm not sure what the actual average ratio is) isn't much either.

itsme86 01-10-2004 04:33 PM

tar is for creating "tape archives". At least that's what it was for originally. The reason tar is still used in conjunction with gzip and bzip is because they only have the ability to compress one file.

gzip's compression is better than zip's (and not much speed difference). bzip2's compression is better than gzip's, but takes a bit longer to compress. Decompression between bzip2 and gzip is hardly noticeable though.


All times are GMT -5. The time now is 11:25 PM.