Find and remove DOS line endings on Ubuntu

前端 未结 7 1492
攒了一身酷
攒了一身酷 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:20

    On ubuntu, you use the fromdos utility

    fromdos test.txt
    

    The above example would take a MS-DOS or Microsoft Windows file or other file with different line separators and format the file with new line separators to be read in Linux and Unix.

提交回复
热议问题