Linux-although I am not an O & M engineer for simulating dos2unix commands, I have encountered some interesting problems due to studying linux and shell scripts, for example, we often upload text files in the window environment to linux. Due to the different terminologies of the two, sometimes the configuration problem occurs because linux does not know the terminator of the original window environment, in this way, we can re-Add the terminator under the original Terminator. We can use cat-v-E test.txt to view the data.-v indicates that the hidden character-E indicates that the Terminator is displayed, the data is as follows: www.2cto.com 395439881 ^ M $ ^ M is the ending character of the window file, which is displayed in linux, $ is the ending character 395423434 ^ M $395468635 ^ M $395436444 ^ M $395463623 ^ M $. Well, we will replace the ending character in the window, otherwise it will not work properly, we can use the following methods to process www.2cto.com cat test.txt | Tr-d '\ R' | cat-v. Let's use cat-v to check whether the character is successfully replaced. 395439881395423434395468635395436444395463623. What if the hidden character is not \ r? cat-v test.txt | sed's: \ (\ ^ \ w \ + \):: '| cat-v 395439881395423434395468635395436444395463623 note that cat-v may display hidden characters in special ways. Therefore, you can directly replace them when passing through pipelines, here, after cat-v, \ r cannot represent the window Terminator, which is converted ...... Mcat test.txt | sed's: \ r: '| cat-v is the easiest way to use the dos2unix command.