943,737 Members | Top Members by Rank

Ad:
Jan 18th, 2004
0

Creating a zip

Expand Post »
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/
Similar Threads
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Jan 20th, 2004
0

Re: Creating a zip

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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Mar 22nd, 2004
0

Re: Creating a zip

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.
Reputation Points: 10
Solved Threads: 2
Light Poster
Eico is offline Offline
41 posts
since Mar 2004
Mar 22nd, 2004
0

Re: Creating a zip

I usually use a shoe horn, some baby oil, and a really big mallet. :p
TKS
Reputation Points: 108
Solved Threads: 18
Posting Pro in Training
TKS is offline Offline
470 posts
since Jan 2004
Mar 22nd, 2004
0

Re: Creating a zip

Quote 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:
Reputation Points: 87
Solved Threads: 12
Posting Whiz in Training
i686-linux is offline Offline
208 posts
since Mar 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Applications and Software Forum Timeline: Red Hat 9 and Windows 2000 dual boot
Next Thread in Linux Applications and Software Forum Timeline: check this out





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC