I need to compress a considerable number of pdf and txt files but I want to leave the file structure untouched. The directories have many, many subdirectories.
When I want to compress files of a specific type in a single directory I run:
for i in `find | grep -E "\.pdf$|\.txt$"`; do gzip "$i" ; done
but this would take me years to do by hand.