Linux中的 dos2unix 命令

原创
2021/10/19 21:51
阅读数 155
  1. dos2unix是将Windows格式文件转换为Unix、Linux格式的实用命令。Windows格式文件的换行符为\r\n ,而Unix&Linux文件的换行符为\n. dos2unix命令其实就是将文件中的\r\n 转换为\n。
  2. 而unix2dos则是和dos2unix互为孪生的一个命令,它是将Linux&Unix格式文件转换为Windows格式文件的命令。

在使用前要先安装dos2unix

yum install -y dos2unix

命令语法:

dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...]
unix2dos [options] [-c convmode] [-o file ...] [-n infile outfile ...]

简单用法:

dos2unix xxx.sh

更多可参考:https://www.cnblogs.com/Tunan-Ki/p/11940575.html

展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部