Test Multiple Zip Archive Files on macOS
- Open the Terminal.
- Replace the bracketed part with the path to a directory and run the following code.
find [path] -type f -iname '*.zip' -exec unzip -tq {} \; > diagnostics.txt
- Now we are going to forward only the error messages from the log to find faulty files, so simply run the following code.
grep -v "No errors detected" diagnostics.txt > errors.txt
- (optional) If you are looking for a simple list of faulty files, run the following codes.
grep -e "At least one error" -e "cannot find zipfile directory" errors.txt > errors-list.txt
- These text files are going to be located in your home folder.
Note that not all files flagged as error-ridden will produce an error when decompressed. Both this method and the GUI utility relies on the unzip command from the same package, which was originally released in 1989. It is why the GUI utility and even the command itself is literally a can of worms. Unzip was originally released for classic Mac and Linux, it then later ported on OS X, creating another incompatibility between the standards. This is why simply switching the default encoding on Text Edit cannot display properly; Text Edit is displaying the contents with UTF-8, but with different normalization. While I would call for a new software suite, this method still works if the sole purpose it to test Zip files; however, remember that there will always be false-positives.