Linux中的 dos2unix 命令

  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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章