Solved

Getting gzip to work right

Posted on 1998-06-18
5
278 Views
Last Modified: 2010-04-20
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
Comment
Question by:bross073097
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
scrytch earned 50 total points
Comment Utility
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
 

Author Comment

by:bross073097
Comment Utility
Thanks

Worked great!.


0
 

Author Comment

by:bross073097
Comment Utility
I tried to grade it, but know I can't. Please reply so I can get you your points.

Thanks
Bob Ross

0
 

Expert Comment

by:scrytch
Comment Utility
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
 

Author Comment

by:bross073097
Comment Utility
I must have clicked it and didn't see it. Great!.

Thanks again.


0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now