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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI 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.
"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