CentOS 7.7 converts the file format to dos unix file format

1, presentation background:

The 10 Windows in 3 files test.txt , test1.txt and test2.txt by Xftp uploaded to CentOS 7.7 , using vim After opening the file find the following tips:

image.png

image.png

image.png

View 3 types of files:

image.png

2, the end of the line to view the file line breaks:

In vim type in : e ++ ff = unix

image.png

Exit vim

3, modifying a single file format:

In vim , type : the SET FF = UNIX , save and exit vim to open the file again later

image.png


4, batch convert file formats:

# yum -y install dos2unix

# find /tmp -type f | xargs dos2unix -o

image.png

Note: -o option indicates that converts documents written in old

5, once again view the 3 types of files:

image.png

image.png

image.png

image.png

Guess you like

Origin blog.51cto.com/qiuyue/2470898