Ubuntu18.04系统如何用unix2dos将unix格式文件转为dos格式
发布时间:2021-09-24 04:28
在windows中创建的文本默认为dos格式,而在linux系统中创建的文本默认为unix格式。各个平台使用的文本编码规范不同,同一文本在不同系统中显示有时候会发生一些莫名其妙的状况,因此有时需要对文本格式进行转换。那么在ubuntu18.04中如何用unix2dos将unix格式文件转为dos格式呢?本文给出详细说明。
1.更新软件列表
sudo apt update

2.安装dos2unix
sudo apt install dos2unix

3.使用unix2dos对文件进行转换
vi test.txt
可以看到文件为默认unix格式

unix2dos test.txt

转换后
