I have a directory with *.txt files.

How can I list the txt filenames that are still having non-unix eol's? So windows and mac eols.

  • Have a look at this
    – anon
    Jan 28, 2017 at 15:53

2 Answers 2


"mac eols" (carriage returns) are rare since around 2000 (i.e., since OSX was first released). For finding files with CRLF endings, the file utility is helpful, since it is looking at more than grep might.

Further reading


You could use "file" command. When a file is using CRLF EOL, "file" returned

filename: ASCII text, with CRLF line terminators

for UNIX EOL, it returns:

filename: ASCII text

Not the answer you're looking for? Browse other questions tagged .