zip
Create and modify ZIP archives
TLDR
SYNOPSIS
zip [options] archive files...
DESCRIPTION
zip creates and modifies ZIP archives, a widely supported compressed archive format. It compresses files using the DEFLATE algorithm (or store without compression) and packages them with metadata including names, timestamps, and permissions.ZIP archives are cross-platform compatible and supported natively on Windows, macOS, and most Unix systems. The format supports directory structures, encryption, and archives spanning multiple files.zip can create new archives, add files to existing ones, update changed files, or delete entries. It's commonly used for file distribution, backups, and data exchange.
PARAMETERS
-r
Recurse into directories.-9
Maximum compression.-0
Store only (no compression).-e
Encrypt archive (prompts for password).-P password
Use specified password.-u
Update only changed files.-f
Freshen (update existing entries only).-d
Delete entries from archive.-x pattern
Exclude files matching pattern.-i pattern
Include only matching files.-j
Junk directory paths.-q
Quiet mode.-v
Verbose output.-m
Move files into archive (delete originals after successful archiving).-g
Grow (append to) an existing archive.-T
Test archive integrity after creation. Aborts if the check fails.-@
Read file list from stdin.-s size
Split archive into pieces of the given size (e.g. `100m`, `1g`).-sf
Show the files that would be operated on, then exit without creating the archive.-FS
Sync archive contents with the filesystem: add new files, update changed files, and remove entries not on disk.-y
Store symbolic links as links rather than following them.
CAVEATS
Default encryption is weak (ZipCrypto); use 7z for strong encryption. Maximum file size is 4GB without ZIP64. Password on command line is insecure. Timestamps may lose precision.
HISTORY
The ZIP format was created by Phil Katz for PKZIP in 1989. The Info-ZIP project was started the same year to provide free implementations. Info-ZIP's zip became the standard Unix ZIP utility and is included in virtually all Unix-like systems. The format has evolved to support larger files (ZIP64) and better compression.
