LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gunzip files in all sub-folders (https://www.linuxquestions.org/questions/linux-newbie-8/gunzip-files-in-all-sub-folders-561937/)

devinnull 06-14-2007 09:50 PM

gunzip files in all sub-folders : RESOLVED
 
So somehow I messed up making a gz file I made as a backup while I moved a web site from one server to another. What I have now is a bunch of directories that unziped but, all the files in every directory are still FILENAME.PHP.GZ. and not unziped like the other directories.
example:
/var/www/sitename/
/var/www/sitename/folder1/
index.php.gz
/var/www/sitename/folder2/
subdir1
subdir2
index.php.gz
/var/www/sitename/folder3/
subdir1
subdir2
index.php.gz
...times hundreds of folders...

What I am hoping is that there is a way to un-compress any .gz files under a given path.

Thanks in advance!!!

Dark_Helmet 06-14-2007 11:32 PM

Code:

find /var/www/sitename -type f -iname "*.gz" -exec gzip -d {} \;
The find command is a tool you need to become comfortable with (man find)

devinnull 06-15-2007 01:12 AM

Quote:

Originally Posted by Dark_Helmet
Code:

find /var/www/sitename -type f -iname "*.gz" -exec gzip -d {} \;
The find command is a tool you need to become comfortable with (man find)

Awesome, and thanks for the help! Yet another powerful window opened.


All times are GMT -5. The time now is 03:08 PM.