Wednesday, July 18, 2012

linux create zip command

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.

No comments:

Post a Comment