How Do You Unzip Files Using Ubuntu (Using the Command Line Interface)?

Goal:  You want to use unzip with Ubuntu Linux without using the GUI desktop.
Background:  The unzip character-based utility is useful for many reasons.  At the command line you can access compressed files that normally occupy little space on the disk.  Transferring .zip files is great for keeping network bandwidth utilization low.

Try this command to see if unzip is installed: man unzip

Part 1:  Installing Unzip
If the command cannot be found, use this command:  sudo apt-get install unzip

If the above command does not work, (for example, you do not have access to the Internet, and your network has no Debian package repositories configured), get the file from here:  https://packages.debian.org/wheezy/unzip

To find the correct installation media (and choose the correct link from the website above), you need to determine the architecture.  To do this, use this command: dpkg --print-architecture

Once you get the correct file on to Ubuntu, install it with this command: dpkg -i unzip.*.deb

Part 2:  Using Unzip
Now that unzip is installed, you can use it with a command like this (assuming you have a file named foobar.zip):

unzip foobar.zip

The above command will decompress the contents while retaining a copy.  The extracted contents will be decompressed in the same directory you run the command in.  The extracted files will not go to the directory where foobar.zip is if you use the path of foobar.zip in the invocation of the unzip command (e.g., if you are in /root/ and run unzip /tmp/foobar.zip the extracted files will go into the /root/ directory).

Leave a comment

Your email address will not be published. Required fields are marked *