I want to search for files containing DOS line endings with grep on Linux. Something like this:
grep -IUr --color \'\\
dos2unix has a file information option which can be used to show the files that would be converted:
dos2unix -ic /path/to/file
To do that recursively you can use bash’s globstar option, which for the current shell is enabled with shopt -s globstar:
dos2unix -ic ** # all files recursively
dos2unix -ic **/file # files called “file” recursively
Alternatively you can use find for that:
find -exec dos2unix -ic {} + # all files recursively
find -name file -exec dos2unix -ic {} + # files called “file” recursively