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

2.安装dos2unix
sudo apt install dos2unix

3.使用dos2unix对文件进行转换
vi test.txt
可以看到文件为dos格式
dos2unix test.txt

转换后

本文来源:
https://www.zonghengcloud.com/article/9093.html
[复制链接]
链接已复制