0

I know I can remove __MACOSX in a zip file by:

sudo zip -d bg1.zip "__MACOSX*"

but I want to remove it in all zip files, I tried

sudo zip -d *.zip "__MACOSX*"

but it says

zip warning: name not matched: __MACOSX*

zip error: Nothing to do! (bg1.zip)

and seems stop from processing next file. How can I remove all __MACOSX in a list of zip files?

ggrr
  • 261
  • 3
  • 4

1 Answers1

4

If all .zip files are in the same directory, cd to that directory and use:

for f in *.zip; do zip -d "$f" "__MACOSX*"; done
user3439894
  • 58,676