Re: Can you untar selectively?

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

 



On Tuesday 14 June 2005 22:04, stefaan wrote:
> How would I go about untarring a particular file selectively out of a
> tarball.
>
> Is this possible at all if I know the path/filename existing in the
> tarball?
yup, use:
tar -xf tarfilename  path/of/desired/file

If not sure of path/of/desired/file use
tar -tf tarfilename
to get a list of contents
Paths are relative paths, i.e., they do not start with a /
when extracted the desired file is in the path as specified starting in your 
current directory.  I think that there is an option to put it elsewhere.

If tar file is compressed with gzip insert the "z" option before the "f"
tar does not care about the format of the tarfile name.  It does not require 
a .tar suffix.

If the tarfile is compressed and you forget the "z" option it will say that 
the file does not look like a tar file.  You can also use the "file" command 
to find out what the file contents is.
-- 
Paul Almquist
paul@xxxxxxxxxxxxx
Eau Claire, WI  USA


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux