Hello there! The easiest way to unzip a file using the Terminal (Command Line) is by making use of the unzip command.
You will get an error "bash: unzip: command not found" if you do not have to unzip the binary installed on your Linux/Ubuntu/macOS.
Step 1: Installing unzip command
Based on which Operating System you are on, make use of the package manager to get unzip installed. Below is an example using apt-get for Ubuntu,
# apt-get update
....
....
# apt-get install unzip
The following NEW packages will be installed:
unzip
...
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package unzip.
(Reading database ... 4389 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-26ubuntu3.1_arm64.deb ...
Unpacking unzip (6.0-26ubuntu3.1) ...
Setting up unzip (6.0-26ubuntu3.1) ...

Note: You may need sudo privileges.
Step 2: Using unzip command to unzip files
Example 1: Unzip a file in the current location# unzip mydata.zip
Archive: mydata.zip
extracting: a.txt

Example 2: Unzip a file in a directory
# # unzip -d ~/myDir mydata.zip
Archive: mydata.zip
extracting: /root/myDir/a.txt
Make use of the -d flag followed by the directory path where you want to unzip the zip file.

Have Questions? Post them here!
- [Fix] Linux - bash: useradd: command not found
- Calculate days between dates using dateutils ddiff command
- pwd Command - Print Working Directory
- Rename a directory using Linux/Unix command
- How to go to the End of File in Nano Editor
- How to tar.gz a directory or folder Command
- How to remove/delete a directory in Linux/macOs
- How to Display content of a file in Terminal Screen?
- ls command sort by file size [Linix/UNIX/macOS/bash]
- How to Copy Entire Directory to another Directory in Linux
- 3 ways to clear screen on Linux Terminal
- Command to check Last Login or Reboot History of Users and TTYs
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to backup a file in Linux/Unix
- Command to know the installed Debian version?
- Check SSH/OpenSSH version Command
- 3 Commands to stop Nginx Server
- Linux: Create a New User and Password and Login Example
- How to install npm on Ubuntu
- How to List All Users in Linux
- How to Get the List of Shells on Linux
- Fix - ssh-copy-id no identities found error
- Installing and using unzip Command to unzip a zip file using Terminal
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- zsh hello world example
- FileZilla Connection time out Failed to retrieve directory listing - FTP
- Java get day of the week as an int using DayOfWeek - Java
- How to display directory tree in Mac Terminal - MacOS
- How to Update Brew on Mac - MacOS
- SharePoint Excel error - The workbook cannot be opened because it contains the following features that are not supported by Excel in the browser - SharePoint
- How to hide toolbar on Notepad++ - NotepadPlusPlus
- How to remove app from Dock when closed [macOS Big Sur] - MacOS
- How to record PowerPoint slide show presentation on Mac - narration, slide timings, ink gestures - Microsoft