How to tell binary from text files in linux

后端 未结 8 1004
[愿得一人]
[愿得一人] 2021-02-07 13:52

The linux file command does a very good job in recognising file types and gives very fine-grained results. The diff tool is able to tell binary files f

8条回答
  •  醉梦人生
    2021-02-07 14:52

    The diff manual specifies that

    diff determines whether a file is text or binary by checking the first few bytes in the file; the exact number of bytes is system dependent, but it is typically several thousand. If every byte in that part of the file is non-null, diff considers the file to be text; otherwise it considers the file to be binary.

提交回复
热议问题