General
cancel
Showing results for 
Search instead for 
Did you mean: 

extract specific files from backup.tar.gz in HPUX

SOLVED
Go to solution
ouazir
Frequent Advisor

extract specific files from backup.tar.gz in HPUX

hello,
i want to extract a specific file from tar zipped backup what is the commande that i must use ?
the above commande give no results
cat backup.tar.gz|gunzip|tar -xvf- specific_file
5 REPLIES
rariasn
Honored Contributor

Re: extract specific files from backup.tar.gz in HPUX

Hi:

gunzip < backup.tar.gz |tar -xvf -

rgs,
Dennis Handly
Acclaimed Contributor

Re: extract specific files from backup.tar.gz in HPUX

Try: gzcat backup.tar.gz | tar -xvf - specific_file
Note that file must match the name when it was stored. You may need -tvf to get the right name.
Hakki Aydin Ucar
Honored Contributor
Solution

Re: extract specific files from backup.tar.gz in HPUX

To extract the compressed tar archieve target.tar.gz OR .tgz into the current directory in a single step:

# gzip â d target.tar.gz | tar xf â
OR

To list .tgz archieve
# gzip -dc DIRECTORY.tgz | tar tvf -
ouazir
Frequent Advisor

Re: extract specific files from backup.tar.gz in HPUX

thanks a lot, your replay was helpfull
muruganantham raju
Valued Contributor

Re: extract specific files from backup.tar.gz in HPUX

Hi,
The following example would help.

#tar -tvf test.tar
rwxrwxrwx 0/3 0 Aug 3 10:26 2010 test/
rw-rw-rw- 0/3 0 Aug 3 10:26 2010 test/cac
rw-rw-rw- 0/3 0 Aug 3 09:50 2010 test/a1
rw-rw-rw- 0/3 0 Aug 3 09:50 2010 test/a2

To extract get cac file

#tar -xvf test.tar test/cac
x test/cac, 0 bytes, 0 tape blocks

HTH
Muru