CRLF vs LF: Line Ending Differences and How to Fix Them
Windows CRLF vs Unix LF line endings: why they differ, how they break scripts and diffs, and how to normalize line endings in Git, editors, and CI.
Published:
Tags: text, developer-tools, programming
CRLF vs LF: Line Ending Wars Between Windows and Unix If you have ever opened a file in a text editor and seen characters everywhere, or had a shell script fail with "bad interpreter: No such file or directory" despite the file existing, you have been a victim of mixed line endings. The vs problem is one of the oldest cross-platform compatibility issues in computing, and it still bites developers regularly. --- The Origin of the Problem In the early days of computing, teletype machines required two characters to move to the next line: CR (Carriage Return, , ): Move the print head back to column 1 LF (Line Feed, , ): Advance the paper one line Windows inherited () from DOS, which inherited it from CP/M, which mirrored physical teletype behavior. Unix systems simplified to just (). Old Mac…
All articles · theproductguy.in