Operating System - HP-UX
1834389 Members
1954 Online
110066 Solutions
New Discussion

Is there a single command to tar and gzip?

 
SOLVED
Go to solution
Brad Beard
Occasional Advisor

Is there a single command to tar and gzip?

I'm looking for a command that will tar up a directory and gzip it as well. Is there a single command that can take care of both of these tasks without having to tar the directory then gzip it up? Thanks.
2 REPLIES 2
Alan Riggs
Honored Contributor
Solution

Re: Is there a single command to tar and gzip?

tar cvf - | gzip > name.tar.gz
Rick Garland
Honored Contributor

Re: Is there a single command to tar and gzip?

GNU tar is available from the porting center for 10.20 and 11.00. Can use the -z or -Z option to tar and gzip;

tar -czvf archieve.tar.gz $files


To untar a gziped archieve;

gunzip -c archieve.tar.gz | tar xvf -