zip / unzip
What is zip / unzip?
zip / unzip: Zip / Unzip — Create or extract .zip archives. zip and unzip create and extract .zip archives. zip -r export.zip reports/ compresses a folder, and unzip export.zip -d target/ extracts it into a chosen folder. unzip -l lists the contents without extracting. Zip files are the most widely supported archive format, which makes them a good choice for files you share with people on Windows or macOS, or for downloads generated by your application.
Frequently asked questions about zip / unzip
What should you keep in mind with zip / unzip?
For server backups, tar is often preferred because it keeps Unix permissions and ownership better. When extracting archives from unknown sources, list the contents first, because archives can contain paths that write outside the target folder. In PHP, the ZipArchive class lets an application build zip downloads, such as a batch of invoices, without calling command-line tools.
At a glance
| Category | CLI commands |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |