Arockia Raj
Arockia Raj

Reputation: 51

Error "caution: filename not matched" - unzip command

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?

Upvotes: 4

Views: 16689

Answers (3)

alonegame
alonegame

Reputation: 87

I found the solution on another site. The * symbol must be escaped, so you should run this instead:

unzip \\*.zip

Upvotes: 1

iman kazemayni
iman kazemayni

Reputation: 1343

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

Upvotes: 1

Anonymous
Anonymous

Reputation: 338

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.

Upvotes: 11

Related Questions