undo a gzip recursively

7,958

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
Share:
7,958

Related videos on Youtube

Bevan
Author by

Bevan

Electrician with an IT leaning

Updated on September 18, 2022

Comments

  • Bevan
    Bevan over 1 year

    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

  • Bevan
    Bevan over 7 years
    So simple, yet couldn't find it anywhere online. Worked for me, thanks.
  • G_Style
    G_Style almost 4 years
    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/…