我知道如何使用dos2unix
将文件格式从dos更改为unix,但是如何将所有文件更改为目录树下。 dos2unix
可以recursion地改变文件吗?
例如,我有一些如下所示的文件:
TOPDIR | +-----dir1 | | | +---file1,file2, file3 | +-----dir2 | +---file4,file5
我怎样才能改变他们在一次,或使用一些shell脚本?
最好做find /path -type -f -exec dos2unix '{}' \;
find /path -name '*' -type f -exec dos2unix {} \;
dos2unix -k `find . -type f` find . -type f -exec dos2unix -k '{}' \; find . -type f -print | xargs dos2unix -k
TOPDIR可以使用以上任何一个命令