zip

From Gentoo Wiki
Jump to: navigation, search

Resources

zip provides classic zip compression. It is handy for cross-platform compatibility with Microsoft operating systems. Newer versions of zip include support for Unicode and encryption. These can be enabled or disabled at built time on Gentoo systems by their respective USE flags (see below).

The equal and opposite program to zip is unzip, which is included in a separate package (app-arch/unzip).

Installation

USE flags

USE flags for app-arch/zip Info ZIP (encryption support)

bzip2 Use the bzlib compression library global
crypt Add support for encryption -- using mcrypt or gpg where applicable global
natspec Use dev-libs/libnatspec to correctly decode non-ascii file names archived in Windows. local
unicode Add support for Unicode global

Emerge

After adjusting USE flags:

root #emerge --ask app-arch/zip

Optionally emerge app-arch/unzip for unzip capabilities (see the unzip article for more information).

Removal

root #emerge --ask --unmerge app-arch/zip

Configuration

Environment variables

zip does not have any configuration files, however its operation is modifiable by the following environment variables:

  • ZIPOPT - Can be used to set any option for the zip command.
  • ZIP - Does the exact same thing as the ZIPOPT variable (directly above).
  • Zip$Options - For RISC OS use. Does the exact same thing as the ZIPOPT variable (directly above).
  • Zip$Exts - For RISC OS use. Contains extensions separated by a : (colon) that will cause native filenames with one of the specified extensions to be added to the zip file with basename and extension swapped.
  • ZIP_OPTS - For VMS use. Does the exact same thing as the ZIPOPT variable.

Usage

Invocation

zip

user $zip --help
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-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 OS files)
  -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
  -@   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 zipfile prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -e   encrypt                      -n   don't compress these suffixes
  -h2  show more help

zipcloak

user $zipcloak --help
ZipCloak 3.0 (July 5th 2008)
Usage:  zipcloak [-dq] [-b path] zipfile
  the default action is to encrypt all unencrypted entries in the zip file

  -d  --decrypt      decrypt encrypted entries (copy if given wrong password)
  -b  --temp-path    use "path" for the temporary zip file
  -O  --output-file  write output to new zip file
  -q  --quiet        quiet operation, suppress some informational messages
  -h  --help         show this help
  -v  --version      show version info
  -L  --license      show software license

zipnote

user $zipnote -h
Copyright (c) 1990-2008 Info-ZIP - Type 'zipnote "-L"' for software license.

ZipNote 3.0 (July 5th 2008)
Usage:  zipnote [-w] [-q] [-b path] zipfile
  the default action is to write the comments in zipfile to stdout
  -w   write the zipfile comments from stdin
  -b   use "path" for the temporary zip file
  -q   quieter operation, suppress some informational messages
  -h   show this help    -v   show version info    -L   show software license

Example:
     zipnote foo.zip > foo.tmp
     ed foo.tmp
     ... then you edit the comments, save, and exit ...
     zipnote -w foo.zip < foo.tmp

  "@ name" can be followed by an "@=newname" line to change the name

zipsplit

user $zipsplit -h
Copyright (c) 1990-2008 Info-ZIP - Type 'zipsplit "-L"' for software license.

ZipSplit 3.0 (July 5th 2008)
Usage:  zipsplit [-tipqs] [-n size] [-r room] [-b path] zipfile
  -t   report how many files it will take, but don't make them
  -i   make index (zipsplit.idx) and count its size against first zip file
  -n   make zip files no larger than "size" (default = 36000)
  -r   leave room for "room" bytes on the first disk (default = 0)
  -b   use "path" for the output zip files
  -q   quieter operation, suppress some informational messages
  -p   pause between output zip files
  -s   do a sequential split even if it takes more zip files
  -h   show this help    -v   show version info    -L   show software license

See also

  • p7zip - A command-line port of 7-Zip for POSIX compliant systems.
  • tar - GNU's tarball generator software (used extensively by Gentoo Linux).
  • unzip - A decompressor for pkzip-compressed files.

External resources