方法一:dos2unix & unix2dos
yum install -y dos2unix
#windows -> unix
dos2unix <the windows text file>
#unix -> windows
unix2dos <the unix text file name>
方法二:perl
#windows -> unix
perl -i -pne 's/\r\n/\n/g' <the windows text file>
#unix -> windows
perl -i -pne 's/\n/\r\n/g' <the unix text file>