1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-11 14:55:40 +02:00
tldr/pages/linux/zip.md

34 lines
1.4 KiB
Markdown
Raw Normal View History

2022-07-07 06:47:47 +10:00
# zip
> Package and compress (archive) files into a Zip archive.
2022-07-07 06:47:47 +10:00
> See also: `unzip`.
> More information: <https://manned.org/zip>.
- Add files/directories to a specific archive:
2025-03-12 21:05:58 +02:00
`zip {{[-r|--recurse-paths}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
2022-07-07 06:47:47 +10:00
- Remove files/directories from a specific archive:
2025-03-12 21:05:58 +02:00
`zip {{[-d|--delete]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
2022-07-07 06:47:47 +10:00
2025-03-12 21:05:58 +02:00
- Archive files/directories excluding specified ones:
2022-07-07 06:47:47 +10:00
2025-03-12 21:05:58 +02:00
`zip {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}} {{-x|--exclude}} {{path/to/excluded_files_or_directories}}`
2022-07-07 06:47:47 +10:00
- Archive files/directories with a specific compression level (`0` - the lowest, `9` - the highest):
2025-03-12 21:05:58 +02:00
`zip {{[-r|--recurse-paths]}} -{{0..9}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
2022-07-07 06:47:47 +10:00
- Create an encrypted archive with a specific password:
2025-03-12 21:05:58 +02:00
`zip {{[-r|--recurse-paths]}} {{[-e|--encrypt]}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
2022-07-07 06:47:47 +10:00
- Archive files/directories to a multi-part [s]plit Zip archive (e.g. 3 GB parts):
2022-07-07 06:47:47 +10:00
2025-03-12 21:05:58 +02:00
`zip {{[-r|--recurse-paths]}} {{[-s|--split-size]}} {{3g}} {{path/to/compressed.zip}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
2022-07-07 06:47:47 +10:00
- Print a specific archive contents:
2025-03-12 21:05:58 +02:00
`zip {{[-sf|--split-size --freshen]}} {{path/to/compressed.zip}}`