Posts for February, 2010

Tar: extract one or more files from an archive

February 22, 2010 Posted in Command & Utility

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.



Archives