I have a ZIP archive, foo.zip, with some files not contained within a directory. I want to extract them to the local foo directory. I'm trying to extract them with this command:

unzip -v foo.zip -d ./foo

However, the output says it is not extracting:

caution:  not extracting; -d ignored
Archive:  foo.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    2345  Defl:N     1234  47% 2018-07-16 00:00 0123456f  bar
    ...   ...         ...  ... ...        ...   ...       ...
--------          -------  ---                            -------
   34567            23456  32%                            n files

Why is it ignoring the -d argument and not extracting?

up vote 11 down vote accepted

It’s not extracting because you used the -v option, which instructs unzip to only show you the catalog of the archive, without extracting it.

Since the -d option only makes sense when extracting, it warns you that it’s ignoring it, but it errs on the side of caution and doesn’t extract.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.