Why we always make tar files and zip in unix environment
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > Why we always make tar files and zip in unix environment




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Why we always make tar files and zip in unix environment  
Prince of Code


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 07:57 AM

Hi all,
This is my first post on this group.

Pls give ur valuble idea for my following question

In Unix systems to make compressed file ( ZIP file in windows ) we need
to tar and then zip it

but in windows we simply zip it. Is TARing a file is a must if so what
is the reasson or can we do

only ZIPing without TARing.

Looking for a elobrate & clear explanation , some kind of web refrence
will be of greate help.

Thankzzz

Regards
Prince Of Code






[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 07:57 AM

2006-01-18, 22:41(-08), Prince of Code:
> Hi all,
>     This is my first post on this group.
>
> Pls give ur valuble idea for my following question
>
> In Unix systems to make compressed file ( ZIP file in windows ) we need
> to tar and then zip it

No, in Unix, we archive the files (put them together in one
file) then compress it (make its size smaller).

> but in windows we simply zip it.

No, we compact them, it's generally the term used to archive and
compress at the same time. winzip archives and compress at the
same time.

> Is TARing a file is a must if so what is the reasson or can we
> do

Archiving is a must if you want to end up with one file out of
several. If not, you can compress every file without making an
archive of them.

> only ZIPing without TARing.

You'd need to define "ZIPing". If you mean compacting, then it's
archiving and compressing which either a combination of tar+gzip
or tar+compress or tar+bzip2 or zip or arc... can do.

If you mean "compressing", then gzip or bzip2 or compress will
do, but that's not what winzip does on Windows (winzip on
windows archives and compresses).

--
Stéphane





[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Alvin SIU


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 07:57 AM

Prince of Code wrote:
> Hi all,
>     This is my first post on this group.
>
> Pls give ur valuble idea for my following question
>
> In Unix systems to make compressed file ( ZIP file in windows ) we need
> to tar and then zip it
>
> but in windows we simply zip it. Is TARing a file is a must if so what
> is the reasson or can we do
>
> only ZIPing without TARing.
>
> Looking for a elobrate & clear explanation , some kind of web refrence
> will be of greate help.
>
> Thankzzz
>
> Regards
> Prince Of Code
>

Hi,

"tar" seems cannot compress file.
In unix, compressing a file needs the "compress" command
to get a .Z file
Another way is to use gzip.

I use "tar" to put many files together in one file.

The reason are:

1. You can put many file in different directories into 1 file
and then send/distribute to others

2. For every month, I used to "tar" all those log files into one file
and then compress the tar file into a backup directory.
This tar file will be deleted 6 month later.

3. "tar" related files into one files.  For example, put all
the the programs, manual, help files, etc into one tar file
Then, these many tar files will form a version-control series.

These are my uses of tar files.
Manybe others have some more usages of tar files.


Alvin SIU





[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 01:11 PM

In article <1137652894.650586.317540@g44g2000cwa.googlegroups.com>,
"Prince of Code" <princeofcode@gmail.com> wrote:

> Hi all,
>     This is my first post on this group.
>
> Pls give ur valuble idea for my following question
>
> In Unix systems to make compressed file ( ZIP file in windows ) we need
> to tar and then zip it
>
> but in windows we simply zip it. Is TARing a file is a must if so what
> is the reasson or can we do
>
> only ZIPing without TARing.
>
> Looking for a elobrate & clear explanation , some kind of web refrence
> will be of greate help.

The general philosophy of Unix is to have lots of tools that each do one
job, and then connect them together when you want to perform more
complex operations.  So there's one tool that combines multiple files
into an archive file, and a separate tool that compresses files.  If you
want a compressed archive, you simply use them both.

This also gives you options for how you connect them.  One way is to
combine all the files into an archive, and then compress that result.
Alternatively, you could compress each individual file, and then combine
these compressed files into an archive.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***





[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Prince of Code


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 01:11 PM

Thankzzz a lot for all replies. Its really encouraging. Keep up this
spirit.


Prince of Code






[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Bruce Barnett


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-19-06 11:24 PM

"Prince of Code" <princeofcode@gmail.com> writes:

> In Unix systems to make compressed file ( ZIP file in windows ) we need
> to tar and then zip it

No you don't. Not with GNU tar.
Do it in one step, if you want to.

NO COMPRESSION:  tar cf archive.tar files*
COMPRESS:        tar cfZ archive.tar.Z files*
GZIP:            tar cfz archive.tar.gz files*
BZIP:            tar cfj archive.tbz files*

You can even use your own compression program.

--
Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.





[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
William


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-06 11:03 PM

"Prince of Code" <princeofcode@gmail.com> wrote in message
news:1137652894.650586.317540@g44g2000cwa.googlegroups.com...
> Hi all,
>     This is my first post on this group.
>
> Pls give ur valuble idea for my following question
>
> In Unix systems to make compressed file ( ZIP file in windows ) we need
> to tar and then zip it
>
> but in windows we simply zip it. Is TARing a file is a must if so what
> is the reasson or can we do

You can just zip it in unix, too. You might have to install
a zip utility (I use info-zip's version), but it isn't hard
and zip (esp. info-zip) offers a lot of benefits that tar
doesn't. We dropped the use of tar in installs because zip
is much more consistent, robust, and eliminates the extra
steps. (The archives can be read by winzip, too, which is a
plus given our mixed environment.)

Tar is ubiquitous, though, so if you simply can't count on
unzip being around, or can't supply it yourself, then it is
the fallback.

-Wm


-Wm








[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
No_One


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-21-06 07:49 AM

On 2006-01-20, William <Reply@NewsGroup.Please> wrote:
>
> You can just zip it in unix, too. You might have to install
> a zip utility (I use info-zip's version), but it isn't hard
> and zip (esp. info-zip) offers a lot of benefits that tar
> doesn't. We dropped the use of tar in installs because zip
> is much more consistent, robust, and eliminates the extra
> steps. (The archives can be read by winzip, too, which is a
> plus given our mixed environment.)

Tar does not compress files, it simply archives the files and file
structure, gzip or bzip2 do the compression.  Gzip can be called with the
tar command without using a pipe.

I seem to recall, from my windows days, that winzip, the purchased version,
does recognize tar.gz file and, IIRC, tgz files.

ken






[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
William


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-22-06 11:10 PM

"No_One" <no_one@no_where.com> wrote in message
news:slrndt3dq3.93p.no_one@localhost.localdomain...
> On 2006-01-20, William <Reply@NewsGroup.Please> wrote: 
>
> Tar does not compress files, it simply archives the files and file
> structure, gzip or bzip2 do the compression.  Gzip can be called
> with the tar command without using a pipe.

I didn't mean to infer that tar alone compresses files, I meant
it has shortcomings as an archive utility. Gnu tar is an
improvement, but at the cost of portability so you might as
well just switch to something actually designed for the purpose,
and which does the right thing by default (and compresses).

> I seem to recall, from my windows days, that winzip, the
> purchased version, does recognize tar.gz file and, IIRC,
> tgz files.

Sort of. It uncompresses to a tar file in a temp location then
displays the tar contents. I've never actually tried to use it
to modify a tar file's contents through winzip - I can't say it
wouldn't work, therefore. Winzip's format is directly compatible,
ignoring a few OS quirks like permissions, including the archive
comment string (which pops up in a Window under winzip).

-Wm









[ Post a follow-up to this message ]



    Re: Why we always make tar files and zip in unix environment  
Timothy Larson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-22-06 11:10 PM

I think it's worth mentioning that WinZip compresses the individual
files, then archives them into one file.  This is less efficient than
archiving first (tar) followed by compression (gzip/bzip2/compress) -
with a larger initial file you can make better use of repeated patterns
in the compression stage.

Tim





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:36 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register