Monday 11 August 2008

Extract a specific file from tar archive

If gzipped, first run gunzip {filename}.tar.gz Then...

tar --extract --file={filename}.tar {file(s) to extract}

HOW TO: list files within a gzipped tar

tar -tzf file.tar.gz

-t: lists files
-f: instructs tar to deal with the following filename (file.tar.gz)
-z: informs tar that the it's dealing with a gzip file (-j if it's bzip2)