dos2unix
安装
yum install dos2unix 或 sudo apt-get install dos2unix
使用
DOS转UNIX
dos2unix print.sh
UNIX转DOS
unix2dos print.sh
dos2unix整个目录
下面列出怎么对整个目录中的文件做dos2unix操作:
$ find . -type f -exec dos2unix {} \;
其中具体命令的解释如下:
find .
= find files in the current directory
-type f
= of type f
-exec dos2unix {} ;
= and execute dos2unix on each file found