1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-01 23:17:56 +01:00
tldr/pages/common/zip.md
Being simple e00f9214ef add a zip cmd
zip exclude some patterns
2016-02-20 11:59:18 +08:00

499 B

zip

Package and compress (archive) files into zip file.

  • Package and compress multiple directories and files:

zip -r {{compressed.zip}} {{/path/to/dir1 /path/to/dir2 /path/to/file}}

  • Add files to an existing zip file:

zip {{compressed.zip}} {{path/to/file}}

  • Remove unwanted files from an existing zip file:

zip -d {{compressed.zip}} "{{foo/*.tmp}}"

  • Remove unwanted pattern files from target dirs:

zip -r {{compressed.zip}} {{target_dirs}} -x \*.git\* \*node_modules\* ...