On Wed, Dec 14, 2011 at 22:42, Tony Duell <ard at p850ug1.demon.co.uk> wrote:
? Now, a major
annoyance I find are tarballs that vomit files in the curr=
ent
directory instead of a subdirectory based off the name of the tar file
(usually foobar.tar will, when extracted, create a directory called fooba=
r
that contains the files; but that's a *convention* not mandatory). =20
Actually, I prefer tarfiles that put their files in the current
directory. I normalyl start by creating a suitable directory somewhere,
copying the tarfile to it and extracting it. I don't want ot used up with
my directory containing just hte tarfile and another diesctory that is
the start of the tree for the files I've extracted.
The safexst thing to do (and what I always do now) is to tar -tvf it
first Then you can see what it's goign to do and act accordingly.
If a tar-file unpacked its content in a subdirectory based on the name
of the tar file there would be a lot of hassle and trouble. As one
example, just imagine a backup of a full system disk. When unpacking
it it should end up in /, not in /some-tar-file-name/. And what if you
have, say, 30 different tar files that you want to unpack somewhere to
build up a tree of the files you need? If they all ended up in some
subdirectory you would have to go in afterwards and clean up. Major
job and lots of hassle.
In any case, the tar file name may not even be known, consider 'cat
some-tar-file.tar | tar xvf -', or 'tar xvf - < some-tar-file.tar'.
No, the way it works is the right way. And use tar tvf, as was suggested.
-Tor