Jabb Jabb - 1 year ago 55
Linux Question

Gunzip multiple files in folder and continue on error

I am unzipping multiple files in a folder like this:

gunzip -f -k *.gz


Some of the .gz files are broken which cause the command to abort.

What is a nice way of unzipping all files while ignoring the broken ones?

Answer Source

Use this loop as suggested by @Gene

for file in `*.gz`
do
   gunzip -f -k $file
done