Operating System - HP-UX
1753309 Members
6438 Online
108792 Solutions
New Discussion юеВ

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 5
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