CR LF means "Carriage Return, Line Feed" - it's a DOS hangover from the olden days from when some devices required a Carriage Return, and some devices required a Line Feed to get a new line, so Microsoft decided to just make a new-line have both characters, so that they would output correctly on all devices.
CR低频意味着“回车,换行”——这是一个DOS宿醉从古代一些设备需要回车时,和一些设备需要换行得到一个新行,所以微软决定让一个新行字符,都使他们将在所有设备输出正确。
Windows programs expect their newline format in CRLF (\r\n
). *nix expect just LF data (\n
). If you open a Unix text document in Notepad on windows, you'll notice that all of the line breaks dissapear and the entire document is on one line. That's because Notepad expects CRLF data, and the Unix document doesn't have the \r
character.
Windows程序在CRLF (\r\n)中期望他们的换行格式。*nix只希望得到LF数据(\n)。如果在windows上的记事本中打开一个Unix文本文档,您将注意到所有的行都中断了,整个文档都在一行上。这是因为Notepad需要CRLF数据,而Unix文档没有\r字符。
There are applications that will convert this for you on a standard *nix distro (dos2unix and unix2dos)
有一些应用程序可以在标准的*nix发行版(dos2unix和unix2dos)上为您转换此内容。
For those wondering, a carriage return and a line feed differ from back in Typewriter days, when a carriage return and a line feed were two different things. One would take you to the beginning of the line (Carriage Return) and a one would move you one row lower, but in the same horizontal location (Line Feed)
对于那些想知道的人来说,回车和换行与打字机时代的回车和换行是不同的。一个人会带你到线路的开头(回车),一个人会把你移动到一个低的位置,但是在相同的水平位置(换行)