How does one compres files in this .tar.gz .Z and .tar.Z

How does one compres files in this .tar.gz .Z and .tar.Z

Post by Luis F. Ullo » Wed, 20 Mar 1996 04:00:00



I'm quite new at this and I don't know how to compress into
this formats.

if you do gzip, you get a .gz   file, but how do I get the rest...

Also which is better????

Luis

 
 
 

How does one compres files in this .tar.gz .Z and .tar.Z

Post by Juergen Exn » Thu, 21 Mar 1996 04:00:00



->   I'm quite new at this and I don't know how to compress into
->   this formats.
->
->   if you do gzip, you get a .gz   file, but how do I get the rest...

"tar" isn't a compressed format, it's an archive (man tar)
"tgz" is an acronym for "tar.gz"
"Z"   is compressed file with standard unix "compress"

->   Also which is better????

AFAIK gzip is a bit more efficent.

jue

 
 
 

How does one compres files in this .tar.gz .Z and .tar.Z

Post by Vern Hox » Sun, 24 Mar 1996 04:00:00




Quote:>I'm quite new at this and I don't know how to compress into
>this formats.

>if you do gzip, you get a .gz   file, but how do I get the rest...

>Also which is better????

First off, read the manual page for 'tar'.

That said, I'll try to give you a perspective on the nomenclature.

The name of the archiver is 'tar' which is an acronym for "Tape ARchiver".

It was originally written as a utility for Unix when the principal means of
mass storage were the big inch wide magnetic tapes on 15 inch spools.  It
provided a means of collecting a group of files into one large file for
transfer to tape, yet allow the individual files to be recovered if
necessary.  The default target for all tar operations is a tape device.
This is why you may see the error message "/dev/rmt0 not found".

AT&T also developed another archiver called 'cpio', from "CoPy In/Out".  It
was an enhanced utility over the original version of 'tar' and was widely
used for transferring large groups of files.  It can be used to copy to
other file systems such as floppies, second drives or even from one
location to another on the same file system.

The GNU project developed an enhanced version of 'tar' and adopted it as
their 'standard' for archiving and distribution of collections of files.  I
suspect that there were copyright problems at the time for not using the
'cpio' concept.  Nowadays there is a GNU 'cpio' which is quite versatile and
does have certain advantages over 'tar' but these are trivial compared to a
major change in policy.

A suffix of '.tar' was adopted by the the GNU project to inform users how
the files could be recovered.  If the tar'red files were also compressed, an
additional suffix of '.Z' was appended to provide 'filename.tar.Z' files.

Although the 'compress' routine was widely and freely distributed, the
copyright holders of the algorithm filed suit and further use became a
legal obstacle.  Hence, the GNU 'gzip' routine was developed.  It in fact
is a slightly better compression algorithm than the original 'compress'.

In order to identify the procedure for retrieving archives which had been
compressed with 'gzip', the GNU project first considered adding a '.z' to
the tar'red file name as in 'filename.tar.z'.  But this caused confusion
with the same suffix which was used by a very old compression routine from
AT&T called 'pack'.  Consequently, GNU adopted the '.gz' suffix to
filenames compressed with their 'gzip'.

The 'tar' utility had an option to compress the archive as it was being
created so they enhanced it to provide the option of using 'gzip' instead.
This resulted in files such as 'filename.tar.gz'.  In an inspirational
moment, this was changed to 'filename.tgz' to indicate that the archive was
created with 'tar' formatting and compressed with the 'gzip' algorithm.

There seems to be a policy in the Linux distributions that 'tar'red
archives include the a subdirectory for the files.  That is, when
untarring a kernel, you put the tarred file in /usr/src and run the command
'tar xzf linux-2.13.tar.gz' and the linux subdirectory will be created as
well as a tree of the various files.  No extraneous files will be added to
/usr/src.  (Note: 'tar' doesn't require a hyphen, '-', infront of the
options but will ignore it one is used.  Also note that the 'f' precedes the
name of the archive.)

However, use caution when untarring archives, this is a policy used by many
contributors, it is not mandatory.  If you untar an archive in a directory
where there are many other files, you may end up with some stray files you
don't know to be part of the new archive or from some other source.  I
always create a clean directory and first untar from there so I can see how
the person who created the archive did it.  If my 'clean' directory has no
stray files in it, I know that it can safely be used any where.
--
Vernon C. Hoxie                                           scicom!zebra!vern

Denver, Colo., 80212        uucp: 303-455-2670          voice: 303-477-1780
          Unix is what MSDOS will be when it becomes an *.

 
 
 

How does one compres files in this .tar.gz .Z and .tar.Z

Post by Robert Nicho » Tue, 26 Mar 1996 04:00:00




>  (Note: 'tar' doesn't require a hyphen, '-', infront of the
>options but will ignore it one is used.  Also note that the 'f' precedes the
>name of the archive.)

Careful, there.  A '-' in front of the options is not ignored.  It
causes a subtle change in the way the argument list is processed.
Without the '-', tar expects to see a single argument containing all of
the option letters, followed by individual arguments containing, in
sequence, the arguments to any of the options that require them.  When
you do use '-', the argument list is parsed in the style of getopt(),
and each option that takes an additional argument is followed
immediately by that string, either as a separate argument or as a
continuation of the current argument.  Thus

    tar xvfT junk.tar listfile
    tar -xvf junk.tar -T listfile
    tar -xvfjunk.tar -Tlistfile

are all legal and equivalent, but

    tar -xvfT junk.tar listfile

is probably incorrect (unless you happen to have a tar archive named
"T" and wish to extract files "junk.tar" and "listfile" from it).

It is somewhat coincidental that

   tar xvf junk.tar
and
   tar -xvf junk.tar

turn out to be equivalent.

--

 
 
 

1. tarzfaq.txt What are and how to handle tar.Z and tar.gz files

Thu 11-Aug-94: Made available the following FAQ (Frequently Asked
Question) answer

 2785 Aug 11 08:49 garbo.uwasa.fi:/unix/ts/tarzfaq.txt
 tarzfaq.txt What are and how to handle tar.Z and tar.gz files

   All the best, Timo

..................................................................
Prof. Timo Salmi      Co-moderator of comp.archives.msdos.announce
Moderating at garbo.uwasa.fi anonymous FTP  archives  128.214.87.1
Faculty of Accounting & Industrial Management; University of Vaasa

2. help: what is the audiotool stereo file format

3. help copying large .tar and .tar.gz files

4. openssl

5. Can tar add files to .tar.gz archives ?

6. Out of Space Problem -- PLEASE HELP, AGAIN.

7. Creation of .tar.gz file in one step

8. ./kde/share/thumbnails/ deletable?

9. EASY .TAR.GZ DOS-Linux file question

10. Install TAR and TAR.GZ

11. Wanted: rcmd host tar x_?_vqf file.tar file1 ... fileN | tar xvf -

12. netscape-i686-pc-linux-gnu-installer.tar.gz for Netscape 6.1 ppc?

13. getting a tar file off a tape when you've tar cf'ed first