Find and remove DOS line endings on Ubuntu

前端 未结 7 1496
攒了一身酷
攒了一身酷 2021-01-04 11:37

I have found that many of my files have DOS line endings. In VI they look like this: \"^M\". I don\'t want to modify files that don\'t have these DOS line endings. How do

相关标签:
7条回答
  • 2021-01-04 12:32

    A modification to the Winning answer if you need to filter by file ending

    grep -URl ^M . | grep .php | xargs dos2unix
    

    I used dos2unix instead of fromdos but the effect should be the same.

    0 讨论(0)
提交回复
热议问题