Tommaso Palomba
Tommaso Palomba

Reputation: 53

unzip a list of archives

I need to Unzipped a list of zip archives. These archives are not empty, in each one there are a lot of file. In my directory I have a lot of file zip archive and all have the the name in the same format: batch-download-ccd-1610959358275.zip but change only the numeric part. I can extract each archive with unzip command but if I try to extract all the archives together with this command unzip *.zip I get this message (For simplicity I report only the example where I try to extract two archives):

Archive:  batch-download-ccd-1610959358275.zip
caution: filename not matched:  batch-download-ccd-1610959397790.zip

Could someone help me please?

Upvotes: 1

Views: 166

Answers (1)

choroba
choroba

Reputation: 242343

unzip takes only one archive as an argument, the remaining arguments are understood as files inside the archive.

Use a shell loop:

for zip in batch-download-ccd-*.zip ; do
    unzip "$zip"
done

Upvotes: 1

Related Questions