Installing Tar

Tom H tomh0665 at gmail.com
Sun Dec 13 19:50:19 UTC 2009


>> I tend to create a directory and perform one of the above actions from
>> within that directory, because I find that some tar files just dump their
>> extracted files in the current directory. This can be rather messy if the
>> current directory contains a lot of files. Most tar files don't behave
>> like this, but I like to play safe.

> You can use the 't' option/flag of tar to determine if the archive
> contains a folder and all files/folders inside it or
> if it does not have such a directory hierarchy.

> tar tvzf archive.tar.gz
> tar tvjf archive.tar.bz2
> tar tvf archive.tar

And if does not have a directory in the tarball, you can create a
directory into which to untar it
mkdir dir4tar
tar xvf archive -C dir4tar




More information about the ubuntu-users mailing list