log / break line types

Types

  • CR LF
  • CR
  • LF

CR LF (Carriage Return Line Feed)

  • Behavior: carriage return character moves the cursor to the beginning of the line while a line feed character moves the cursor to the next line
  • Char: \r\n or 0x0D0A in hexadecimal notation
  • Still widely use in windows environment

CR (Carriage Return)

  • Behavior: CR line break moves the cursor to the beginning of the line to signify a line break
  • Char: \r or 0x0D in hexadecimal notation
  • Originated from Mac OS in 1980s
  • Least common line break type, and still used in MacOS

LF (Line Feed)

  • Behavior: Moves the cursor to the next line without returning to the beginning of the line
  • Char: \n or 0x0A in hexadecimal
  • Originated from Unix and compatible with ASCII standard
Written on 2024-06-06 13:15:00 +0700 Edited on 2024-06-06 13:31:00 +0700