I am learning Linux and I was trying the gzip command. I tried it on a folder which has a hierarchy like


I ran "gzip -r Personal" and now its like


How do I go back?


You can use

gunzip -r Personal

which works the same as

gzip -d -r Personal

If gzip on your system does not have the -r option (e.g. busybox's gzip) , you can use

find Personal -name "*.gz" -type f -print0 | xargs -0 gunzip
  • I changed my working directory to "Personal" and ran "gunzip -r Personal" and got this result "gzip: Personal.gz: No such file or directory" I do have the -r option because I used it to compress my files – Kazim Jan 21 '15 at 10:45
  • As you used gzip -r Personal to compress it, you can run gunzip -r Personal from the same place to decompress it. If you are inside the Personal directory, you need to run gunzip -r . instead (. is the current working directory). – jofel Jan 21 '15 at 10:50

Here is the answer:

Change directories until you're just one step up from the target directory and run this command

gunzip -r Personal
gunzip -r .     <--- if you're in the same directory

. is the current working directory

Thanks @jofel

  • This should be an edit on jofel's answer not a separate answer which adds almost nothing to the existing one... – don_crissti Oct 23 '18 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.