Jabb Jabb - 1 year ago 67
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`
   gunzip -f -k $file
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download