title: How to tell binary from text files in linux
body: <p>The linux <code>file</code> command does a very good job in recognising file types and gives very fine-grained results. The <code>diff</code> tool is able to tell binary files from text files, producing a different output.</p>
  
  <p>Is there a way to tell binary files form text files? All I want is a yes/no answer whether a given file is binary. Because it's difficult to define binary, let's say I want to know if <code>diff</code> will attempt a text-based comparison.</p>
  
  <p>To clarify the question: I do not care if it's ASCII text or XML as long as it's text. Also, I do not want to differentiate between MP3 and JPEG files, as they're all binary.</p>