How can I know if a file is a binary file?
For example, compiled c file.
I want to read all files from some directory, but I want ignore binary files.
Perhaps this would suffice ..
if ! file /path/to/file | grep -iq ASCII ; then echo "Binary" fi if file /path/to/file | grep -iq ASCII ; then echo "Text file" fi