Usando o comando file
:
#!/bin/bash
for i in * # for every file in folder
do
# if file reports "ASCII text"
if file "$i" | grep --quiet 'ASCII text$'
then
# print filename
echo "$i"
fi
done
Um forro:
$ for i in *; do if file "$i" | grep -q 'ASCII text$' ; then echo "$i"; fi; done