Recover a corrupted gz
Writing by shivdev on Wednesday, 14 of October , 2015 at 7:13 am
Sometimes you might be able to salvage a corrupted gzip. Typically this trick always works on most log files.
$ gunzip corrupted.gz
gunzip: corrupted.gz: unexpected end of file
gunzip: corrupted.gz: uncompress failed
Use the -c option that outputs to console, but redirect to a new salvaged file. Then gzip the salvaged file to recover it.
$ gunzip -c corrupted.gz > salvaged
$ gzip salvaged
You can now delete the corrupted gz file and use the salvaged version.
Leave a comment
Category: Linux,Tips and Tricks
- Add this post to
- Del.icio.us -
- Digg -
- -
- Tweet -
-
-
No comments yet.
You must be logged in to post a comment.