Compress all the text files below!

Compress all the text files below!

There was that. I do not know.

find `pwd` | while read line; do (FILE=$(file $line); (echo $FILE | grep -E 'text$' > /dev/null) && (echo $FILE | grep -v '.git' > /dev/null) && zopfli $line); done

I believe there is a better way, so please teach me.


2020-08-31 Addendum

ʻEcho $ FILE | grep ~` I thought I couldn't put it together.

find `pwd` | while read line; do (FILE=$(file $line); (echo $FILE | grep -E 'text$' | grep -v '.git' > /dev/null) && echo $line); done

Recommended Posts

Compress all the text files below!
Read all csv files in the folder
Delete all pyc files under the specified directory
Unzip all zip files under the current directory
Sort large text files
Batch convert all xlsx files in the folder to CSV files