This finds all non-text based, binary, and empty files.
Edit
Solution with only grep
(from Mehrdad's comment):
grep -rIL .
Original answer
This does not require any other tool except find
and grep
:
find . -type f -exec grep -IL . "{}" ;
-I
tells grep to assume binary files as unmatched
-L
prints only unmatched files
.
matches anything else
Edit 2
This finds all non-empty binary files:
find . -type f ! -size 0 -exec grep -IL . "{}" ;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…