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

Re: tar vs



On Sat, 17 Mar 2007 12:08:08 -0400
Frank McCormick <fmccormick@videotron.ca> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> On Thu, Mar 15, 2007 at 02:59:01AM EST, Adam Porter wrote:
> > I've read the man page, googled this list and the rest of the Net, but I
> > still can't figure out why this doesn't work:
> > 
> > $ tar xjf *.tar.bz2
> > tar: beryl-core-0.2.0.tar.bz2: Not found in archive

the first file represents the archive and the next ones the files you want to
extract thus

tar xjf foo.tar.bz2 bar.txt

would try to extract bar.txt from the archive foo.tar.bz2

What you did will only work if there is only one archive in the directory. To
achieve what you want (extract all archives in the directory) you need to do:

for file in *.tar.bz2 ; do tar xjf $file ; done

> > 
> > Am I doing something wrong?  Why can't tar handle a wildcard list like that?
> 
>   As a refugee from DOS/Windos/OS/2  etc etc.....I have a question.
> 
>   What is Linuxs "obsession" with tar ? What is (are) the advantage(s) of tar
> over ZIP/RAR for example.
> 

tar is almost as old as the computer (it's been around since magnetic tapes)
and it represents the *nix philosophy of do one task and do it will

What you do here is separate the work of grouping together files (tar) and
compressing them (most commonly gzip and bzip2 in this case there is also
compress and a few others which are rarely used these days).

zip does all the work in one place, it's also been around for ages but it only
more recently propagated to *nix. I don't know the difference in efficient, but
zip has the drawback that it doesn't store file permissions, owner/group or
links and thus isn't very good for *nix (try to zip a directory and then
extract it, it most probably will all have the executable bit set, mode 755,
and be owned by whomever extracted the files).

rar is not free (in any sense), if you read the package description it says
that it's shareware and needs to be registered if you want to continue using
it. I think that it also can't store owner, permission and links.

> 
> 
> - -- 
> Cheers
> 
> Frank
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> 
> iD8DBQFF/BJo8Rvr3Tn207ARAlyeAJ9mDVdRzgDCcCLcqffqqjGkeCmCDwCeJ1kx
> R0lDV4oAU9WHWT9TNmE3JG0=
> =Y+G7
> -----END PGP SIGNATURE-----
> 
> 



Reply to: