Fix for “caution: filename not matched” error when trying to unzip multiple files at once in Terminal.
Solution for unzipping multiple zip files with a single command.
Open up a Terminal window on OS X, go to the directory containing the zip files and enter this command:
unzip \*.zip
The forward slash escapes (prevents) the wildcard character (the “*”) from being expanded by bash shell interpreter. In English: the files in the directory are the filenames “unzip” is trying to extract from the first file it finds when using “*”.
Example:
/myzips directory contains zip files: first.zip second.zip third.zip
Trying to run: “unzip *.zip” will cause the unzip program to take “first.zip” as the archive to play with, and will look for files “second.zip” and “third.zip” within “first.zip” to expand/extract. Obviously not what you want to do.
Not escaping the * character will result in errors like: “caution: filename not matched”.
Related posts:


11 comments
Comments feed for this article
Trackback link
http://installingcats.com/2008/05/23/caution-filename-not-matched-unzipping-multiple-files/trackback/
September 27, 2009 at 11:53 am
Pingback from Caution filename not matched when unzipping multiple files | Mac OS X Leopard & Tiger Dual Boot | Archive Utility Software
September 20, 2010 at 1:20 am
Trackback from Quora - What should I do if I get a “caution: filename not matched” error when trying to unzip multiple files at once in Terminal?...
December 24, 2008 at 4:44 pm
Peezee
This works on Linux too. Thanks for the tip.
December 25, 2008 at 7:19 am
Ben Lam
Lucky for us, BSD, the base of Mac OS X, has many similarities to Linux.
September 29, 2009 at 8:00 pm
Shaun
Thanks for the tip. Helped me out on Snow Leopard.
January 17, 2010 at 9:57 pm
Uncle Ben
Thanks! I always wondered why “unzip *.zip” didn’t work (as it would in a good ol’ dos box :-D). Cheers.
May 5, 2011 at 2:22 pm
Eric
how do you escape the * character?
May 11, 2011 at 11:45 pm
SEO LABS
Then it is better to use 7 ZIP for extraction…
June 18, 2011 at 12:26 am
Amy
Finally a reason to why I have been getting this freaking message: “caution: filename not matched”. Thanks for a solution.
July 14, 2011 at 9:22 pm
Sam
This is a good little command to have. I’ve run into many problems with zip files.
January 28, 2012 at 5:20 pm
Fernando
Saved my day!
Thanks.