Saturday, August 16, 2008

tar and gzip via a unix pipe to save space

# tar and gzip via a unix pipe
mknod mypipe p
gzip -c <> 9.2.0.tar.gz &
tar cvf mypipe 9.2.0

or

tar cf - gfiprd1appl | gzip -1 -c > gfiprd1appl.tar.gz

# gunzip and untar in one command via a unix pipe
gunzip < 9.2.0.tar.gz | tar xvf -

or

gzip -dc 920.tar.gz | tar -xvf -