[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Getting gzip to work right

Posted on 1998-06-18
5
Medium Priority
?
298 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 200 total points
ID: 1637366
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
ID: 1637367
Thanks

Worked great!.


0
 

Author Comment

by:bross073097
ID: 1637368
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
ID: 1637369
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
ID: 1637370
I must have clicked it and didn't see it. Great!.

Thanks again.


0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 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