DOS和UNIX文件批量转换

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

发布了69 篇原创文章 · 获赞 10 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/mhtqq809201/article/details/88777956
今日推荐