How can i find all the files contains ^M ?

hi
i have lots of text files that contains ^M , now i like to remove them
using dos2unix but first i need to find all of them , what is the best way to do that ?

You can get the list of files containing ^M with the command (^M = ctrl/V+ctrl/M) :

grep -l "^M" *

Jean-Pierre.

As an aside, you can run dos2unix against a text file without carriage returns with no ill effect. Sometimes its easier to just apply the same command against an entire directory.