Creating a zip

Thread Solved

Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Creating a zip

 
0
  #1
Jan 18th, 2004
I didn't realize how to do this until just now so I thought I'd post about it. Suppose you have a directory on your box called "my_files" and you wish to compress it into a zip file. One level above the directory, use the following command

zip -r files.zip my_files/
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Creating a zip

 
0
  #2
Jan 20th, 2004
that is so Windows...

Just kidding. That works great, but you can squeeze even more compression out of it if you use tar with bzip2 compression:

tar -cvjf files.tar.bz2 my_files/

Zip might get about 2x compression, but I've seen bzip2 get anywhere from 2x to 5x compression. If space is a concern, then I'd check it out.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 41
Reputation: Eico is an unknown quantity at this point 
Solved Threads: 2
Eico's Avatar
Eico Eico is offline Offline
Light Poster

Re: Creating a zip

 
0
  #3
Mar 22nd, 2004
yeah, the whole difference with tar.gz and bzip2 is that bzip2 gives you more compression, so file sizes are small, but bzip2 is a lot more resource intensive when decompressing. So when size is an issue, use bzip2.
---------------------------------------
Insomnia: Becoming conscious of your own craziness
Reply With Quote Quick reply to this message  
Join Date: Jan 2004
Posts: 468
Reputation: TKS will become famous soon enough TKS will become famous soon enough 
Solved Threads: 18
TKS's Avatar
TKS TKS is offline Offline
Posting Pro in Training

Re: Creating a zip

 
0
  #4
Mar 22nd, 2004
I usually use a shoe horn, some baby oil, and a really big mallet. :p
My Home Away from Home: Yet Another Linux Blog
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 209
Reputation: i686-linux is on a distinguished road 
Solved Threads: 12
i686-linux's Avatar
i686-linux i686-linux is offline Offline
Posting Whiz in Training

Re: Creating a zip

 
0
  #5
Mar 22nd, 2004
Originally Posted by TKS
I usually use a shoe horn, some baby oil, and a really big mallet. :p
But do you prefer a crowbar or a chisel for decompression?:cheesy:
PARANOIA:
A healthy understanding of the way the universe works.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the *nix Software Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC