-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
I bet you learned this on the night of October 27 😉
I found that ‘tar xpoft’ doesn’t work, but I was able to use ‘tar tf’ to view the contents of the ZIP and then ‘tar xpof’ to unzip it. Thanks!
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 👍