Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

All of my files in my linux server converted to gzip files I need a script for extracting all gzip files (*.gz files)

share|improve this question
    
How did this happen? Surely they didn't just all spontaneously gzip themselves. –  EEAA Jun 29 '12 at 15:43
add comment

1 Answer

up vote 3 down vote accepted
$ find /path/to/files -name "*.gz" -print0 | xargs -0 gunzip
share|improve this answer
    
thank you for your help but can you show me an example of this command –  FTM Jun 29 '12 at 15:46
    
I want to run this command in cpanel can I use cron jobs to do that? –  FTM Jun 29 '12 at 15:47
1  
The example is the answer. –  EEAA Jun 29 '12 at 15:48
    
SSH into your server, then run the command. –  EEAA Jun 29 '12 at 15:49
    
find /path/to/files -name "*.gz" -exec gunzip {} + has the same functionality as piping it to xargs, without the extra process or needing -print0/-0 support. –  astrostl Jun 29 '12 at 15:58
show 7 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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