4

dos2unix *.sh用来转换.sh当前目录中的所有文件。

那么如何转换.sh子文件夹中的所有文件呢?

我试过这个,但它不适用于 bash: How to run dos2unix for all files in a directory and subdirecty in Powershell

4

1 回答 1

8

你可以使用find

find . -type f -name "*.sh" -exec dos2unix {} \+;

这将定位当前目录中的所有*.sh( -name "*.sh") 文件 ( -type f)(也递归到子目录中)并在所有文件上执行dos2unix实用程序

于 2017-12-08T10:27:57.810 回答