Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux zip command

Create a ZIP archive. Add -r when including a directory tree.

Info-ZIP

Syntax

Command form
zip [OPTION]... ARCHIVE.zip FILE...

Common options

7 options
OptionWhat it does
-rRecurse into directories.
-uUpdate entries only when source files are newer or missing.
-d ARCHIVE FILE...Delete entries from an existing archive.
-eEncrypt archive entries with a password prompt.
-qQuiet operation.
-x PATTERNExclude matching paths.
-9Request the slowest, highest compression level.

Usage examples

2 examples

Create a ZIP archive. Add -r when including a directory tree.

zip -r site-backup.zip ./site

Update the archive with a changed file.

zip -u site-backup.zip ./site/index.html

Notes

ZIP encryption compatibility varies; traditional ZIP encryption is not suitable for high-value secrets. Check archive contents before sharing.