Linux Classes
Linux Training
* Linux Classes *

LINUX CLASSES - COMPRESSION, ENCODING AND ENCRYPTION

Can I Zip and Unzip Files With Linux?

The zip and unzip Commands

The zip and unzip programs work almost exactly like their cousins PKZIP and PKUNZIP in the DOS environment. You can squash a bunch of files together into a zip file like this:


zip squash.zip file1 file2 file3

Then you can extract the original files like this:

unzip squash.zip

Most of the flags are the same as for PKZIP and PKUNZIP, but there are a few differences, so you might like to view the help with zip -h or unzip -h if you need anything fancier than the basic commands shown here.

If you use the -k flag when you zip a file under Linux, you can apply PKUNZIP to it under DOS. This flag tells zip to translate the Unix file and directory names into something that fits the more restrictive DOS naming conventions.

For example, if you have Linux files named another.longunix.filename and wontwork.withDOS, the -k flag will cause these files to be stored in the zip file as another.lon and wontwork.wit. If you don't use the -k flag, the PKUNZIP command under DOS will give you an error message and refuse to create the files with the invalid names.

For more information on the zip command, see the zip manual.

For more information on the unzip command, see the unzip manual.

Previous Lesson: Zmore and Zless
Next Lesson: Encoding and Decoding

[ RETURN TO INDEX ]

Comments (most recent first)

Wasantha     (28 Jan 2010, 01:37)
Thanks this is worked for me :-)

*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 

Ask Bob Rankin - Free Tech Support
<Send This Link to a Friend>         <Bookmark This Page>


Copyright © by Bob Rankin
All rights reserved - Redistribution is allowed only with permission.