Solved

Getting gzip to work right

Posted on 1998-06-18
5
280 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

810 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