I want to search for files containing DOS line endings with grep on Linux. Something like this:
grep -IUr --color \'\\
Use Ctrl+V, Ctrl+M to enter a literal Carriage Return character into your grep string. So:
grep -IUr --color "^M"
will work - if the ^M there is a literal CR that you input as I suggested.
If you want the list of files, you want to add the -l option as well.
Explanation
-I ignore binary files-U prevents grep from stripping CR characters. By default it does this it if it decides it's a text file.-r read all files under each directory recursively.