Bill Jonas on Thu, 19 Apr 2001 16:00:18 -0400

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] TAR command line question

On Thu, Apr 19, 2001 at 02:59:14PM -0400, Chuck Peters wrote:
> GNU tar has compression built in, this does the same thing.
> tar czf . file.tar.gz    

Right.  The other way is more portable across various Unices.  Compare
recent evolution in GNU tar with specifying using bzip2.  I've seen it at
least 3 different ways: y, I, and something else.  In that case, 'bzip2
-cd |tar -xf -' would consistently work, and also be useful on a slightly
older version of tar.  Note also that you can use an arbitrary compression
program with GNU tar's '--use-compression-program' switch.

At my present job, our dev box is a Sun running SunOS, and if I go to
uncompress a gzip'd tarball, it is necessary to use command-line pipes.
Although I'll grant you, why not take advantage of the convenience if
you're on a system that lets you.  (I do my untarring and gunzipping on
Linux that way; it was just a way of illustrating a single dash as being
representative of std{in,out} for tar's '-f' option.)

Bill Jonas    *    *
"As we enjoy great advantages from the inventions of others,  we should
be glad of an opportunity to serve others by any invention of ours; and
this we should do freely and generously."          -- Benjamin Franklin

Philadelphia Linux Users Group       -
General Discussion  -