2

I have downloaded a large number of .zip files and need to extract them using 7z (p7zip) at the command line. 7z x filename0001.zip is successful, but 7z x *.zip returns a "No files to process" error.

How can I unzip the files as a batch instead of one at a time?

2 Answers 2

4
for zip in *.zip; do
    7z x "$zip"
done
2

Solution:

ls -1 *.zip | xargs -L 1 7z x

Explanation:

  1. ls -1 *.zip outputs a one-column list of zip files to stdout (ls dash-one, not ls dash-ell)
  2. xargs -L 1 takes each filename returned and passes it to 7z x as a parameter.

Not the answer you're looking for? Browse other questions tagged or ask your own question.