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?

1
  • 1
    Why are you using sudo? Is that necessary? Are all the .zip files in the same directory? Commented Jun 15, 2016 at 11:20

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .