7

OK, so I did a stupid, and forgot to specify a filename in the process of doing a website backup.

Now, all my files say file_name.extn.gz

How do I get all those mistakenly gzipped files back to normal?

I've tried tar, unzip, etc but not successful. The directories are not .gz, only each file inside.

System is 14.04.4 LTS

1 Answer 1

22

What gzip -r does, gunzip -r undoes:

$ gzip foo -r
$ find foo 
foo
foo/d
foo/d/1.gz
foo/a
foo/a/3.gz
$ gunzip -r foo
$ find foo     
foo
foo/d
foo/d/1
foo/a
foo/a/3
2
  • So simple, yet couldn't find it anywhere online. Worked for me, thanks.
    – Bevan
    Jan 8, 2017 at 9:28
  • 2
    I did the same dumb thing to my website and this saved my butt. Thanks guys! The important lesson I learned here is to use Tar to zip your whole site up, not Gzip. unix.stackexchange.com/questions/93139/…
    – G_Style
    Aug 17, 2020 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .