Quote:
Originally Posted by RandomTroll
Code:
for file in *.zip
do
zip -d $file "__MACOSX*"
done
|
First, as a newbie, I'd like to thank you very much RandomTroll for trying to help me. I really appreciate the help.
Unfortunately though, it didn't work. Perhaps I'm misunderstanding what you're saying to do. I typed
Code:
zip -d $file "__MACOSX*"
while in my directory that has all the zip files that have all the __MACOSX files in them, but I got this error:
Code:
zip warning: __MACOSX*.zip not found or empty
zip error: Nothing to do! (__MACOSX*.zip)
So, either I misunderstood what you were telling me to do, or perhaps I was not clear enough in describing what I need to do. If I misunderstood, can you please clarify?
If I was not clear enough, here is a clearer description: I have a directory called CleanZip and in that directory are 4 zip files that I am using as test files:
Code:
[B-18] Minions.zip
[B-18] Small power cell.zip
[B-18] Small Comms Console.zip
[B-18] Sun Lights.zip
In reality, though, I have over a dozen more zip files just like these, with names like these, that I'd like to process. Each zip file contains many files that start with __MACOSX. Here are some examples:
Code:
0 08-27-2018 23:00 __MACOSX/
0 08-27-2018 23:00 __MACOSX/Sun Lights/
120 08-27-2018 20:21 __MACOSX/Sun Lights/._.DS_Store
So, I'm wanting to delete all the __MACOSX files from all four zip files with one command. What would be the exact syntax to do that?