how do i use 'zip'

I didn't even know there was a zip command.

I think most people use gzip, so there may be a man page for that.

-Rob
 
true...gzip works great, but i was looking for a way to make a zipfile so that i could send something a newbie PC-user frined of mine without having to provide full implementation documentation with it...:D
 
Just type 'zip' and you'll get a small manual. Like this:
Code:
Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly
Onno van der Linden and Kai Uwe Rommel. Type 'zip -L' for the software License.
Zip 2.1 (April 27th 1996). Usage:
zip [-options] [-b path] [-t mmddyy] [-n suffixes] [zipfile list] [-xi list]
  The default action is to add or replace zipfile entries from list, which
  can include the special name - to compress standard input.
  If zipfile and list are omitted, zip compresses stdin to stdout.
  -f   freshen: only changed files  -u   update: only changed or new files
  -d   delete entries in zipfile    -m   move into zipfile (delete files)
  -k   force MSDOS (8+3) file names -g   allow growing existing zipfile
  -r   recurse into directories     -j   junk (don't record) directory names
  -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)
  -1   compress faster              -9   compress better
  -q   quiet operation              -v   verbose operation/print version info
  -c   add one-line comments        -z   add zipfile comment
  -b   use "path" for temp file     -t   only do files after "mmddyy"
  -@   read names from stdin        -o   make zipfile as old as latest entry
  -x   exclude the following names  -i   include only the following names
  -F   fix zipfile (-FF try harder) -D   do not add directory entries
  -A   adjust self-extracting exe   -J   junk zip file prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -h   show this help               -n   don't compress these suffixes
 
If you don't want to do anything fancy, using zip should be as easy as,

zip newfile.zip file_to_add1 file_to_add2 ...

which will create newfile.zip
 
gzip will compress without any special arguments. If it's an executable you probably won't get much (any?) compression. If you have a handful of data or text files you'll notice a difference.

Good luck.
 
Winzip and Zip Magic both handle gzipped tar files, don't they? Personally, I prefer the ol' tgz method myself.
 
For tar, use these flags:
c - create archive
v - display list of files as they are added
z - use gzip compression (if you want to)
f - output archive to a file

Examples:
tar -cvzf archive.tgz directory
tar -cvf archive.tar directory
 
Back
Top