zip and unzip Commands – Basic Archiving Updated on January 3, 2024 by InMotion Hosting Contributor 0 Minutes, 59 Seconds to Read 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. Create an archive Extract Files List Archived Files 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. zip -r archive-name.zip path-to-directory-or-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. unzip archive.zip Example: unzip images.zip Extract to Another Directory unzip archive.zip -d another-folder 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 unzip -l archive.zip Used options: -l – list archived files For more options, type the zip --help or unzip --help command. Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Understanding Linux Operating Systems How to Install Python 3.9 on CentOS 7 Speed Up grep Searches with LC_ALL=C How To Install RubyGems On Linux unrar and rar Commands 5 Ways to Find a File in Linux Setting Your PHP Settings in Command Line How to Check the Memory Usage on Linux How to Send Files to the Trash Can in Linux with Gio Trash How to Merge PDF Files in the Linux Terminal