Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

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
0
bross073097
Asked:
bross073097
  • 3
  • 2
1 Solution
 
scrytchCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now