Operating System - HP-UX
1819688 Members
3478 Online
109605 Solutions
New Discussion юеВ

how to extract multiple tar files at time in hp-ux?

 
sokolova
Advisor

how to extract multiple tar files at time in hp-ux?

how to extract multiple tar files at time in hp-ux?
7 REPLIES 7
Sajjad Sahir
Honored Contributor

Re: how to extract multiple tar files at time in hp-ux?


Dear Sokolova

tar -xvf then u file name

thanks


Sajjad Sahir
sokolova
Advisor

Re: how to extract multiple tar files at time in hp-ux?

i have mutiple tar files ,so i wated to extract all the tar files at atime..
plz help me
Steven E. Protter
Exalted Contributor

Re: how to extract multiple tar files at time in hp-ux?

Shalom,

tar1.tar
tar2.tar

tar xvf tar1.tar &
tar xvf tar2.tar &

That runs both processes in the background.

If they conflict, they blow up. You can add a cd or something to extract them in separate directories.

background processes run more slowly and at a lower priority than foreground. untarring files can be input/output intensive and that will make things run even more slowly.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeeshan
Honored Contributor

Re: how to extract multiple tar files at time in hp-ux?

Hi

did you try with
#tar xvf * ??
a warrior never quits
Dennis Handly
Acclaimed Contributor

Re: how to extract multiple tar files at time in hp-ux?

>ahsan: did you try with: tar xvf * ??

Why would that work? You would need a "-f" before each tarfile. And nothing in tar(1) talks about multiple archives.

>SEP: This runs both processes in the background.
tar xvf tar1.tar &
tar xvf tar2.tar &

If you are going to do this, you probably don't want to use "v". Or you want to redirect stdout & stderr for each tar.

Steven Schweda
Honored Contributor

Re: how to extract multiple tar files at time in hp-ux?

As (almost) everyone else has said, you
normally use one "tar" command for each "tar"
file.

I don't see a good reason to do multiple
"tar" operations at one time ("&") instead
of doing one after another.
Yogeeraj_1
Honored Contributor

Re: how to extract multiple tar files at time in hp-ux?

hi,

is this acceptable?

SRV2:tmp>touch a b c d
SRV2:tmp>tar -cvf TAR1.tar a b c d
a a 0 blocks
a b 0 blocks
a c 0 blocks
a d 0 blocks
SRV2:tmp>cp -p TAR1.tar TAR2.tar
SRV2:tmp>for mfile in $(ls -1 ./*.tar); do
> echo "untarring $mfile"
> tar -xvf $mfile
> done
untarring ./TAR1.tar
x a, 0 bytes, 0 tape blocks
x b, 0 bytes, 0 tape blocks
x c, 0 bytes, 0 tape blocks
x d, 0 bytes, 0 tape blocks
untarring ./TAR2.tar
x a, 0 bytes, 0 tape blocks
x b, 0 bytes, 0 tape blocks
x c, 0 bytes, 0 tape blocks
x d, 0 bytes, 0 tape blocks
SRV2:tmp>


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)