LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2011, 11:03 AM   #1
ejaz_nit
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Difference between tar and zip commands.


hi,
I have just started learning linux basic commands.Can any one explain what is the difference between tar and zip commands.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-30-2011, 11:14 AM   #2
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 314

Rep: Reputation: 45
simply tar itself does not compress .
read "< command > --help" and "man < command >"
 
2 members found this post helpful.
Old 06-30-2011, 11:19 AM   #3
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
Tar was started as a way to put many files in a tape (yes is that old). When compressing files became useful the first programs use to compress a single file, so they used tar as a way to group files and then compress that single file. Zip was a replacement for this workflow, and also became a standard.
The commands are asociated with the formats. For information on commands you can see their man pages, info or help in the terminal, like this:

info tar
man tar
tar --help
 
3 members found this post helpful.
Old 06-30-2011, 04:22 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by ejaz_nit View Post
what is the difference between tar and zip commands.
They output archives in different formats.

The "zip" format has built-in compression (and is very popular with Windows users), while the "tar" format is purely an archive format with no compression, and also supports Unix file permissions (and is very popular with Linux users).

Since "tar" files are uncompressed, they are usually compressed afterwards. The most common compression formats used are "gzip", "bzip2", and "xz" (note that all these are purely compression formats, with no archiving fucntionality).
 
2 members found this post helpful.
Old 06-30-2011, 05:27 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,200

Rep: Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563
I could be wrong but the checksum that tar uses is a very old one. I think it was more of a parity deal. It may have been updated since I used it last on a real tape.

Zips have a better checksum ability I'd think.

I always recommend people post even uncompressable files on the web in a zipped format. At least the users would know when they un-zip that their download was good.

Last edited by jefro; 06-30-2011 at 10:25 PM.
 
1 members found this post helpful.
Old 06-30-2011, 09:43 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Originally, tar (Tape Archiver) was a cmd to collect multiple files into one archive; specifically storing on tape.
No compression was available.
gzip was designed to compress a file (or files individually with wildcard '*')

Over the years, compression has become so popular that tar now has the -z switch to implement gzip functionality directly. It also has the -j switch for bzip2 compression.

http://linux.die.net/man/1/tar


Note that this is the GNU version of tar; the orig tar still found on commercial *nix like Solaris, HP-UX does not have those compression switches, although you may find the GNU version avail as well (Solaris /usr/sfw...)
 
1 members found this post helpful.
Old 06-30-2011, 10:09 PM   #7
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
This thread is very informative, as the responses were great, every 1 of them.
 
Old 06-30-2011, 11:10 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,885
Blog Entries: 18

Rep: Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347
The zip that I know started as a DOS program, pkzip, developed by Phil Katz. Tar, gzip, and bzip are native *nix programs.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Could someone convert a tar to zip? SkunkyMonkey General 4 02-07-2009 06:18 AM
regarding .zip or tar.gz swift2008 Programming 4 08-25-2008 06:56 AM
uncompress .zip with "tar -ixz Filename.zip" , can it be done ??? htetnaing Linux - Newbie 2 08-17-2008 06:10 AM
how to zip a folder as tar.gz Dakkar Linux - General 2 01-09-2006 12:51 PM
Tar/Zip Files and Such Godboo Linux - Newbie 2 01-10-2004 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration