tar command

atark at thepipeline.net atark at thepipeline.net
Wed Jul 4 13:06:58 PDT 2001


Just a thought, but to make it more portable since "officially" tar can't 
unpack bzip2 files just use bzcat and zcat.  For example redhat uses the j 
opton instead of the y option for bx2 files.

bzcat tarfile.tar.bz2 | tar xf -

--Andy
atark at thepipeline.net

On Wednesday 04 July 2001 05:54 pm, you wrote:
> On Wed, 4 Jul 2001 emage at spamcop.net wrote:
> > > i.e. "ls *.gz | mawk {'system ("tar xzf " $1 )'}" is _great_ to unpack
> > > all tar-gz packed files in one dir, no typing tar xzf filename.tar.gz
> > > over and over again till you have unpacked everything. same for bzip2,
> > > just use ls *.bz2 and tar xyf
> >
> > You really like awk, don't you?
> >
> > 'for i in *gz; do tar xzf $i; done;'
>
> I use an "unpack" script.
>
> $ unpack *.gz *.bz2 *.zip *.Z
>
> http://cfaj.freeshell.org/src/scripts/unpack-sh.html
>
> > Does the same thing, but requires nothing past bash and is faster to type
> > (less punctuation).  It doesn't really matter though - one of the great
> > things about Linux is the fact that there are usually about three hundred
> > ways to do anything simple.  Thus, you're likely to find one you like
> > <g>.
>
> Sometimes it is faster to pipe a list through awk (or sed, or ...) than
> use a shell loop construct (though not in the above instance).
-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message



More information about the lfs-dev mailing list