Home > Command & Utility > Tar: extract one or more files from an archive

Tar: extract one or more files from an archive

February 22, 2010 Posted by KP

To extract a single file from an archive:
# tar zxvf tarfile.tgz –include=”desiredfile”

Use patterns:
# tar zxvf tarfile.tgz –include=”desiredfile*”

‘desiredfile’ must use full path. To check file’s fullpath:

# tar tf tarfile.tgz

Note: It’s double ‘-’ before include.



Related Posts:

Filed Under: Command & Utility

Leave a Comment

(required)
(will not be published, required)

* Copy this password:

* Type or paste password here:






Archives

Links