If you have a zip file that you downloaded from the internet or was shared with you by an Office colleague or a School friend and you are wondering how do I Unzip this Zip fine via Terminal command, well you can make use of the unzip command.
If unzip is not installed on your device then you will get the below error in the Terminal console based on which Shell you are logged into,
# bash: unzip: command not found
# sh: 1: unzip: not found
% zsh: command not found: unzip
How to install unizip package for Terminal
When you type unzip on your Terminal and you get an error as "unzip command not found" then you will need to install the unzip package in order to unzip a zip file, you can install unzip package using the apt-get or brew package manager,
Example: apt-get# sudo apt-get install unzip
...
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 19 not upgraded.
Need to get 163 kB of archives.
After this operation, 559 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 unzip arm64 6.0-25ubuntu1 [163 kB]
Fetched 163 kB in 11s (14.7 kB/s)
..
Selecting previously unselected package unzip.
Preparing to unpack .../unzip_6.0-25ubuntu1_arm64.deb ...
Unpacking unzip (6.0-25ubuntu1) ...
Setting up unzip (6.0-25ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Now when you type in unzip on Terminal, you should see something like this,
# unzip
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.
Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
Default action is to extract files in list, except those in xlist, to exdir;
file[.zip] may be a wildcard. -Z => ZipInfo mode ("unzip -Z" for usage).
-p extract files to pipe, no messages -l list files (short format)
-f freshen existing files, create none -t test compressed archive data
-u update files, create if necessary -z display archive comment only
-v list verbosely/show version info -T timestamp archive to latest
-x exclude files that follow (in xlist) -d extract files into exdir
modifiers:
-n never overwrite existing files -q quiet mode (-qq => quieter)
-o overwrite files WITHOUT prompting -a auto-convert any text files
-j junk paths (do not make directories) -aa treat ALL files as text
-U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields
-C match filenames case-insensitively -L make (some) names lowercase
-X restore UID/GID info -V retain VMS version numbers
-K keep setuid/setgid/tacky permissions -M pipe through "more" pager
-O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
-I CHARSET specify a character encoding for UNIX and other archives
See "unzip -hh" or unzip.txt for more help. Examples:
unzip data1 -x joe => extract all files except joe from zipfile data1.zip
unzip -p foo | more => send contents of foo.zip via pipe into program more
unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
Unzip command for Terminal
Syntax: unzip zip-file-name.zip
Syntax: unzip zip-file-name.zip [-d destination-older]
Example:Extracting the zip file in current directory,
# unzip abc.zip
Archive: abc.zip
creating: abc/
b2391b608026# ls
abc.zip my-important-file.txt abc
Example:
Extracting the zip file in a different directory,
# unzip abc.zip -d myDir
Archive: abc.zip
creating: 123/xyz/
b2391b608026# ls
myDir abc abc.zip my-important-file.txt xyz
- [Fix] Error 1020 Cloudflare: Access was denied
- What is an Authorization Code Grant? OAuth 2.0
- Fix: psql: error: connection to server at localhost (::1) port 5432 failed: FATAL: database does not exist
- 100+ SEO Tips to improve your website search ranking
- How to submit website to dmoz directory
- How to check the version of NodeJS installed
- How to enter Rockstar Activation Code?
- Background task activation is spurious error - Windows 10, Office 2016, Office 365
- Angular CLI ng Error: You need to specify a command before moving on. Use --help to view the available commands
- cURL HTTP GET request command examples
- Fix - JioCinema Something Went Wrong Please Try Again Error 8001 while streaming IPL Cricket Live
- How to remove password from pdf file
- How to identify the version of IntelliJ
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- Setting up RSS feeds notifications within Outlook
- Fix - Website Connection timed out Error Code 522 (Cloudflare)
- How to fix: Please check your network connection (Retry)
- Fix: Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Accept Only 0-9 Numbers RegEx Example
- How to create a New Project in Visual Studio Code (VS Code)
- Top 10 emerging breakthrough trending technologies
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- [Error] zsh: command not found: mvn
- How to Scan iPhone for Virus? Is Antivirus it really required?
- How to start/boot macOS in safe mode - Big Sur 11.0, Catalina 10.15, or Mojave 10.14 - MacOS
- Download interrupted: Unknown Host dl-ssl.google.com Error Android SDK Manager - Android
- Reopen previously closed tab in Google Chrome - Chrome
- How to fix command not found brew (bash, zsh) on macOS Terminal - MacOS
- How to Clear Gradle Cache on Mac - Gradle
- Fetch as Google Crawl Error or Redirected Status - Google
- How to install and Use Java JDK 21 Initial Release Candidate - Java-JDK-21
- Cannot start Android Studio. No JDK found - Android-Studio