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 filesExample 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.
Facing issues? Have Questions? Post them here! I am happy to answer!
- Rename a directory using Linux/Unix command
- ls command to list only directories
- How to Restart or Reload Nginx Server Service on Linux
- 3 ways to clear screen on Linux Terminal
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: sudo: unable to open Read-only file system
- Create Hidden File or Directory using Shell Command
- Command to know the installed Debian version?
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - bash: man: command not found
- How to tar.gz a directory or folder Command
- How to Display content of a file in Terminal Screen?
- How to change bash terminal prompt string and color
- Sort ls command by last modified date and time
- Execute .bin and .run file Ubuntu Linux
- zsh hello world example
- How to check uptime of Linux/Unix/macOS system/server using console command?
- [Fix] Linux - bash: useradd: command not found
- Command to check Last Login or Reboot History of Users and TTYs
- How to install and Configure sar sysstat tools in Ubuntu Linux
- How to use SCP Command to Copy Directory
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to connect to SSH port other than default 22
- Install OpenSSL on Linux/Ubuntu
- How to Fix Spelling Errors on Microsoft Word for Mac - HowTos
- How to find path of file on Mac Terminal - MacOS
- Merge-SPlogfile PowerShell - SharePoint Correlation ID error - SharePoint
- Fix: Maven - Failed to execute goal - Compilation failure - Source/Target option 5 is no longer supported. Use 7 or later - Java
- A Guide to Dynamically Obtaining Browser Screen Width and Height with jQuery [Updated 2023] - jQuery
- How to remove password from pdf file - HowTos
- How to Indent Python code in Notepad++ - Python
- Programmatically check if Facebook is installed on Android device - Android