<p>I want to search for files containing DOS line endings with grep on Linux.  Something like this:</p>
<pre class="lang-sh prettyprint-override"><code>grep -IUr --color '\r\n' .
</code></pre>
<p>The above seems to match for literal <code>rn</code> which is not what is desired.</p>
<p>The output of this will be piped through xargs into todos to convert crlf to lf like this</p>
<pre><code>grep -IUrl --color '^M' . | xargs -ifile fromdos 'file'
</code></pre>

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.