Zip/Unzip on Linux: Reference and Examples

Last updated:

Zip a single file

$ zip large-file.txt

Unzip a zip file

$ unzip

Zip a directory

$ zip -r large-dir/

Add a password

You'll be prompted for a password to protect your archive (you won't see it typed to the terminal however)

$ zip -e large-file.txt

You can use more than one modifier at the same time (encrypt and zip directory)

$ zip -re large-dir/

Dialogue & Discussion