Add a directory tree to a ZIP archive.
zip -r site-backup.zip ./siteCreate a ZIP archive. Add -r when including a directory tree.
zip [OPTION]... ARCHIVE.zip FILE...Add a directory tree to a ZIP archive.
zip -r site-backup.zip ./siteUpdate the archive with a changed file.
zip -u site-backup.zip ./site/index.html| Option / clause | Description |
|---|---|
-r | Recurse into directories. |
-u | Update entries only when source files are newer or missing. |
-d ARCHIVE FILE... | Delete entries from an existing archive. |
-e | Encrypt archive entries with a password prompt. |
-q | Quiet operation. |
-x PATTERN | Exclude matching paths. |
-9 | Request the slowest, highest compression level. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.