Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "caution: filename not matched" - unzip command [closed]

I am trying to unzip specific files from an archive.

Steps:

ZIP structure

 Archive:  folder/jce_policy-6.zip   9101 bytes   5 files
drwxr-xr-x  2.2 unx        0 bx stor 17-Nov-06 02:10 jce/
-r--r--r--  2.2 unx     2663 tx defN 17-Nov-06 02:10 jce/COPYRIGHT.html
-r--r--r--  2.2 unx     8386 tx defN 17-Nov-06 02:10 jce/README.txt
-rw-r--r--  2.2 unx     2465 bx defN 17-Nov-06 02:10 jce/US_export_policy.jar
-rw-r--r--  2.2 unx     2481 bx defN 17-Nov-06 02:10 jce/local_policy.jar

Copy JAR files:

unzip -o -j vendor/jce_policy-6.zip "*/*.jar" folder1/*.jar

Archive:  vendor/jce_policy-6.zip
  inflating: US_export_policy.jar
  inflating: local_policy.jar
caution: filename not matched:  folder1/*.jar

If I try unzip -o -j vendor/jce_policy-6.zip "*/*.jar" folder1/*

Archive:  vendor/jce_policy-6.zip
      inflating: US_export_policy.jar
      inflating: local_policy.jar
    caution: filename not matched:  folder1/<list the files in the folder>

I googled as much as I could, but I am not sure I found the correct one. How can I do it?

like image 694
Arockia Raj Avatar asked Sep 19 '25 12:09

Arockia Raj


2 Answers

I have a solution.

The above error indicates that you used the unzip command wrongly. Your shell expands the command ‘unzip *.zip’ as follows:

unzip a.zip b.zip c.zip

The solution:

unzip '*.zip'

Doing this shell doesn’t recognize it’s a wildcard character.

like image 130
Anonymous Avatar answered Sep 22 '25 02:09

Anonymous


For me, the case was a space. I had to rename my project name and remove that space and done.

like image 23
iman kazemayni Avatar answered Sep 22 '25 03:09

iman kazemayni