convert dos2unix line endings for all files in a directory

后端 未结 8 615
慢半拍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:19

    Just adding another reference ...

    On Ubuntu 14.04 the man dos2unix page provides this example, specifically for recusive conversion:

    find . -name *.txt | xargs dos2unix

    Quoting from the man page, this will

    ... convert all the .txt files in the directory tree under the current directory ...

提交回复
热议问题