What are other line ending types?

QuestionsQuestions8 SkillsProGit Config ManagementNov, 17 2025
092

In addition to LF (Line Feed) and CRLF (Carriage Return + Line Feed), there are other line ending types used by different operating systems:

  1. CR (Carriage Return):

    • Representation: \r
    • Usage: Used by classic Mac OS (prior to Mac OS X). A text file with CR line endings might look like:
      Line 1\r
      Line 2\r
      Line 3\r
  2. LF (Line Feed):

    • Representation: \n
    • Usage: Used by Unix and Linux systems, as well as modern macOS.
  3. CRLF (Carriage Return + Line Feed):

    • Representation: \r\n
    • Usage: Used by Windows systems.

Summary of Line Ending Types

  • Linux/Unix: LF (\n)
  • Windows: CRLF (\r\n)
  • Classic Mac OS: CR (\r)

Understanding these line endings is important for ensuring compatibility when transferring files between different operating systems.

0 Comments

no data
Be the first to share your comment!