The behaviour I'd like with unzip is to extract all files, overwriting any that are older than those in the archive, not touching any that are the same age or newer, and to never prompt.

The options available seem to be:

  • -o: overwrite all files, even if they're the same age or older
  • -f: extract only files that exist on disk and are older.

Is there a way to get this behaviour?

1 Answer 1


While writing the question, I see the answer: two steps.

$ yes no | unzip myarchive.zip # Unzip only things that don't exist on disk
$ unzip -f myarchive.zip # Unzip things that (now) exist on disk and are newer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .