-bash: unzip: command not found

In case the unzip bash command in macOS Terminal.app is not available or working – e.g. when in the Recovery Mode of a Mac – but you still need to unzip a ZIP file, you can use the tar command instead!

Unzip a ZIP file using tar in the Terminal bash

(Optional) preview contents of a ZIP file using tar

cd /directory/where/zip-file/is/located
tar ft zip-file.zip

Extract the ZIP file using the tar command to the same location

tar xop zip-file.zip

…or if you need to extract the files to a different location add:

tar xop zip-file.zip -C /another/directory/to/extract/to

Remarks about verbose output

The “t” in “xopft” (for tar) or “-v” (for unzip) both enable respective verbose mode – so you’ll see in the Terminal window what is going on during the extraction. If you don’t want this, just remove the respective characters from the commands.

Regular unzip of a ZIP file using the Terminal bash on macOS

In “normal” cases, meaning whenever the unzip-command is available – e.g. when running macOS normally – you can more easily unzip a ZIP-file using the Terminal as follows:

cd /directory/where/zip-file/is/located
unzip -v zip-file.zip
Share:
  • 3
  • 1

3 thoughts on “macOS Terminal: unzip a ZIP file using the tar command in bash”

    1. Thanks for pointing this out, Jamy. It seems there’ve been some changes to the tar-command and its parameters in recent years.

      I updated the post to apply with the new way to do it 👍

Questions? Suggestions? Let us know with a comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.