Table of Contents
Learn how to create, extract, and list files within a compressed zip archive in Secure Shell (SSH), or cPanel Terminal, with the zip
and unzip
commands.
Spend more time working on your website than setup with our Shared Hosting – Softaculous Instant Installer and WP-CLI ready to go.
Compress Files
Use the zip
command to manage compressed files.
Example: zip -r images.zip *.png
– Archive all PNG image files in the current directory into a images.zip file
Example: zip -r backup.zip *
– Archive all files and folders in the current directory into a backup.zip file
Used options:
-r
– Travel the directory structure recursively
Decompress Files
Instead of zip
, use the unzip
command to manage compressed files.
Example: unzip images.zip
Extract to Another Directory
Example: unzip images.zip -C restored
– Extract files from the images.zip file into the existing /restored folder
Used options:
-d
– Specify directory
List Files
Used options:
-l
– list archived files
For more options, type the zip --help
or unzip --help
command.