Score:0

Get corrupted *.zip archives list

na flag

Sorry for my bad English. I have a folder with *.zip archives. And this folder contains corrupted archives. How can I get corrupted archives list?

I need to check folder and remove corrupted *.zip archives. How can I do it? Thanks in advance.

Terrance avatar
id flag
Just something quick. You can use the `-T` switch for the `zip` command to test the archive to see if it is good or not. So, if you run something like `for i in *.zip; do zip -T "$i"; done` from that directory it should be able to show you what zip archives are good and which ones are bad.
user467566 avatar
na flag
Thanks a lot! It's working.
user467566 avatar
na flag
So, how I can to remove file, if is corrupted? I'm just started to use linux, so I don't know.
Terrance avatar
id flag
`rm filename` will delete the file.
pLumo avatar
in flag
You may be able to fix corrupted zip archives with `zip -F ...` or `zip -FF file.zip --out fixed.zip`.
Raffa avatar
jp flag
Extending @Terrance comment ... Something like `for f in *.zip; do if ! zip -Tqq "$f" > /dev/null; then echo rm -v -- "$f"; fi; done`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.