Before you say these two brothers, do an experiment first:
I create a new left text file Test.txt under Win7, and then open it in Notepad and enter the following to save
Then use UltraEdit to open in hexadecimal mode, as shown in the following figure
First, regardless of what you see above, open vim in Debian, enter the same content and save it as a Test.txt file.
Then enter the command in VIM:
:%!xxd
View the file in 16-way, as shown in the following illustration:
Okay, front. I'm putting two files hex code into the following handy for comparison:
Win7:6F 0D 0A 6F 62 65 32
Debian: 6F 0A to 6F to 0A
This time you see clearly, 0x0d said carriage return is ' \ R ', 0x0a means ' \ n '.
From the above results we can draw the following conclusions:
1. Under win, a "return key" means a combination of "\ r \ n", while under Linux, it means "\ n";
2. In both systems, the same document content is not necessarily the same size;
3. In Linux, each row will be in its last line line character, and win only in the real input enter key will insert "\ r \ n";
4. After you delete all the contents of the file under Vim, do you think the file is empty? Experiments have shown that it is not empty
Do you understand??? Welcome to pass ~ ~ ~
Refer to a useful article http://www.jb51.net/article/26547.htm
Original from: Cnblogs SoBe