How to find files with ^M from linux using csh
-
05-07-2019 - |
Question
Is there a csh script/command to list all the files in source source tree which have line endings that show up as "^M" in emacs (under linux).
Thanks!
Solution
Based on my answer to another question:
fgrep -rl `echo -ne '\r'` .
OTHER TIPS
find . -type f -exec grep $'\r' {} +
The $'\r'
probably requires bash to function correctly.
find . -type f -print | xargs grep 'cntl-M$'
where cntl-M has been entered by first entering cntl-V
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow