tar command

Chris F.A. Johnson c.f.a.johnson at home.com
Wed Jul 4 14:54:36 PDT 2001


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).

-- 
	Chris F.A. Johnson	    bq933 at torfree.net
	=================================================================
	c.f.a.johnson at home.com	    http://cfaj.freeshell.org
	cfaj at freeshell.org	    http://members.home.net/c.f.a.johnson

-- 
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