8

So I tried to make a gzipped backup of my entire directory structure, but I inadvertently issued the command gzip -r ./, hoping to add all files and folders to a single gzip archive.

This obviously is very wrong, but before I had time to quit, it gzipped each of my files individually (recursively) and deleted the original. Now I have a file structure that is completely made up of gzipped files. Does anyone know the command to undo what I have done (ie. extract the gzip file in place and then delete the gzip file)?

Edit: Credit to Greg, gunzip -r ./' solved it!

veerman
  • 81

1 Answers1

12

To undo this, use the opposite command:

gunzip -r ./

Note that the original gzip command will skip over files that already have a .gz suffix, because there's no point in compressing them twice. However, the above gunzip command will decompress such files, because it doesn't know that gzip skipped them.

Greg Hewgill
  • 5,619