
Quick fix for Linux and Windows line endings Or, in this case, two hours of debugging ending in madness and me contemplating a new career in woodworking. So, when you create a file on one system and use it on the other, hilarity ensues. The reasons don't matter: Windows chose the CR/LF model, while Linux uses the \n model.

Just think about that 300 bits per second three hundred. We're talking about 300 baud modems here, folks. You paid for every byte, back then, so cutting costs was important. So, it was decided that one and only one character would be used for a carriage return and line feed, the so-called new line character. But long distance calls were expensive, so minimizing the time and data sent was paramount. This allowed the transmission of text around the world, across telephone lines. Meanwhile, over in the world of automation, the Teletype machine became very popular. (Please excuse more poetic license as I romanticize about typing.) Teletype They are two distinct and separate actions, but anyone who has mastered the manual typewriter knows that they are typically done in one, swift, soulful, and athletic motion, akin to desktop gymnastics of the highest order. You can move the carriage without feeding one line, and you can advance one line without moving the carriage. When you do both movements, you get "carriage return plus line feed," sometimes abbreviated to CRLF or CR/LF. In addition, as the lever moves, it advances the paper up one line, which is known as a line feed. When you reach the edge of the paper, you use the big lever on the far left to return the carriage to the starting position that is, you perform a carriage return.

(That rubber cylinder is technically known as a platen, but stay with me as I employ poetic license and use "carriage.")Īs you type, the carriage moves to the left. The typewriter mechanism that holds the rubber cylinder is called the carriage because it carries the paper. Figure 2: What a manual typewriter looks like.
