convert dos2unix line endings for all files in a directory

后端 未结 8 523
慢半拍i
慢半拍i 2021-01-31 09:42

Currently, I am using the following command to change dos2unix line endings, but this is for file-y file...

sed -i \'s/\\r//\' filename

Is ther

相关标签:
8条回答
  • 2021-01-31 10:44

    Simple:

    sed -i 's/\r//' filename1 filename2 … filenameN
    

    or, if you are speaking about content of one directory

    sed -i 's/\r//' *
    

    Work just well for me.

    0 讨论(0)
  • 2021-01-31 10:44
    dos2unix *.txt
    

    works fine to convert all *.txt files in a directory... no need for the 'find' command.

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