Getting gzip to work right

I tring to compress and extract on the Linux box.

I want to compress files a directory under /tmp and all the subdirectories and files. Send it to someone and when they decompress it have it create the same directories and subdirectories. I tried it the same way as the dos pkzip but it leave all the files mixed in one file.

Any help in this would be great.

I hope this is easy, I see a ot of others doing it.

Thanks in advance
Bob Ross
bross073097Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
scrytchConnect With a Mentor Commented:
Gzip only compresses single files, not entire directories.  The unix equivalent would be a gzip'ed tarball.  To create a compressed archive of the /tmp directory, you would type this:

     tar zcvf tmp.tar.gz /tmp

The user would then untar it with this

     tar zxvf tmp.tar.gz

Or if tar complains about the z flag:

     gunzip tmp.tar.gz; tar xvf tmp.tar


0
 
bross073097Author Commented:
Thanks

Worked great!.


0
 
bross073097Author Commented:
I tried to grade it, but know I can't. Please reply so I can get you your points.

Thanks
Bob Ross

0
 
scrytchCommented:
I'm assuming you got grading to work, since the points and the 'A'  grade just popped up for me.  My first grade, and it's an A.  Made my day :)
0
 
bross073097Author Commented:
I must have clicked it and didn't see it. Great!.

Thanks again.


0
All Courses

From novice to tech pro — start learning today.