What can I replace with _____ to recursively gzip every file starting at myFolder and have the gzip be overwrite the file (rename the gzip file to the original filename)?
migrated from stackoverflow.com Jul 31 '09 at 20:51
This question came from our site for professional and enthusiast programmers.
A simple, not very elegant bash script is to simply cd in, gzip them all in a loop, and mv them back (gzip by default removes the non-compressed file):
Put that in a file called "gzip_and_rename.sh" for example, chmod -775 and run it like ./gzip_and_rename.sh (if running from within myFolder itself, remove the "cd myFolder" line from the script).