convert dos2unix line endings for all files in a directory

后端 未结 8 550
慢半拍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条回答
  •  旧时难觅i
    2021-01-31 10:37

    Another option: find your_dir type f -exec sed -i 's/\r//' {} \;

    Why aren't you using dos2unix command? If your'e doing just the sed above there might be files (depending on their source) that will have incorrect EOF (you can see it if you run cat and the prompt afterwards is concatenated to the file output)

提交回复
热议问题