Linux end of the line to add data to a file, the data is added to the line

When we create a new file in the windows, and you want to upload to linux, be sure to add a space after the file, otherwise there will headline speaking, the data is appended to the end of the line on the line, rather than a new line but if a new file on linux, do not have this requirement, the following chart, created a new file more.properties, use nodepad ++ you can see the bottom right corner to open the display as Windows (CR LF), upload it to the linux, dos2unix windows using the unix character into character, to which the new data is added, the data is spliced ​​to the end of the line by line

File, add the line breaks, re-upload to the server will not appear on the above-mentioned problems, although the file format or windows, but it is strongly recommended to modify the format of unix, use nodepad ++ on windows can also be modified.

 

If the file is only one line of data, will prompt "with no line terminators", and problems and solutions and the same as above.

 

 To sum up, if it is uploaded to a file on linux on windows, suppose you want to use scripts to add data to it dynamic, then you must not forget to add a line break after the last line, if it is on linux new data, is not the limit, Also strongly recommended to upload a file on linux unix format should be changed, otherwise, unexpected problems may occur.

Guess you like

Origin www.cnblogs.com/qq931399960/p/11431294.html