Linux xargs command analysis and recursive execution of dos2unix command

It is the way to convert Windows DOS format and Unix format

Line endings are different for Linux and Windows text files. In Linux, text files use "/n" to represent carriage return and line feed, while Windows use "/r/n" to represent carriage return and line feed. Therefore, errors often occur when using Windows text files in Linux.

In order to avoid this kind of error, Linux provides commands for converting two text formats: dos2unix and unix2dos,

dos2unix converts "/r/n" to "/n",

unixtodos converts "/n" to "/r/n".

The use of commands dos2unix and unix2dos is very simple, the format is: dos2unix filename

Batch file conversion:

-type f: Indicates that the file type is a normal file.

find -type f |xargs dos2unix

https://www.cnblogs.com/JasonCeng/p/15806834.html

Guess you like

Origin blog.csdn.net/m0_46829545/article/details/129692267