LinuxMall.com Got Linux? CD Offer
Newbie's Linux Manual
Winzip or Linzip? - The zip and unzip Commands
by Laurence Hunter
[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip
As Easy as WinZip

Zipping a directory and all of its contents in Linux is extremely easy. Here's the command required, at its most basic:

zip -r zipname path

For example, the following will zip the entire contents of the directory mywork. The resulting zip file will be called myzip.zip:

zip -r myzip mywork

Then to unzip it, simply enter:

unzip myzip
Changing The Compression Rate

By default, the compression rate used, is 6. 0 gathers together all the files but does not compress them, 1 applies the least compression, and 9 applies the maximum compression. The greater the compression, the longer it takes to zip and unzip files.

Here's an example:

zip -r myzip -9 mywork
Winzip's Compression vs. zip's

In case you're curious about the difference in compression rates between Winzip 7.0 and the zip command, I can tell you this. 15 web pages totalled 1.83Mb. The best I could get with Winzip was 620k, and the best I could get with Linux was 623k. That means Winzip has a better compression rate of 0.14%! I'm not about to get picky about it, are you? (And if you're getting out a calculator to check my sums, you definitely need to get out more!)

For More on zip...

For the full nitty-gritty on zip (as with most things in Linux), enter:

info zip
[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip

W W W . L I N U X D O T . O R G

The Newbie's Linux Manual is reproduced on LinuxMall.com by permission. The Newbie's Linux Manual is written and maintained by Laurence Hunter. You can find much more of Laurence's work at his site: www.Linuxdot.org

© 1999 Linuxdot.org | Manual's Copyright Terms