Thursday, August 11, 2011

find command to exclude binary files

In order to exclude binary files in Linux use the file command 

find . -type f | xargs file | grep -i  ASCII |cut -d: -f1


file command in this case executes the each of the file returned by the find command 
grep ASCII returns only the file having content in the ASCII format
"cut -d: f1"   returns the file name .