- The following syntax creates a zip archive:
$ zip archive_name.zip file1 file2 file3...
Consider this example:
$ zip file.zip file
Here, the file.zip file will be produced.
- The -r flag will archive folders recursively:
$ zip -r archive.zip folder1 folder2
- The unzip command will extract files and folders from a ZIP file:
$ unzip file.zip
The unzip command extracts the contents without removing the archive (unlike unlzma or gunzip).
- The -u flag updates files in the archive with newer files:
$ zip file.zip -u newfile
- The -d flag deletes one or more files from a zipped archive:
$ zip -d arc.zip file.txt
- The -l flag to unzip lists the files in an archive:
$ unzip -l archive.zip