Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 13
    This choice predates POSIX by many years. As mentioned in jlliagre's answer, it goes back to the beginning of Unix, which copied it from Multics. Commented Dec 20, 2017 at 17:16
  • 4
    The choice in Linux does not predate POSIX by many years. Of course POSIX codified what was already existing practice, since that was its whole reason to exist. Commented Dec 20, 2017 at 18:26
  • As far as Linux is concerned, there was no real choice to make in the first place. The Gnu standard library which is used by Linux is contemporary to POSIX, and was using line-feed since its inception for obvious compatibility reasons because it was developed, tested and used on Unix systems. The Linux kernel was designed to provide Unix like system calls to a standard C library (GNU or other) and adding the complexity required to handle differently text files and binary files would have been overkill and break compatibility with existing code. That would have been nonsensical from Torvalds. Commented Dec 30, 2017 at 14:41
  • @jlliagre: It was still a choice to make something compatible with existing practices rather than random gratuitous incompatibilities. You can only say that wasn't a choice in the context of assuming Linux's success. Plenty of people make toy hobbyist OS's full of gratuitously wacky choices and they never go anywhere. Commented Dec 30, 2017 at 16:12
  • @R I mean Linux is only a kernel and it essentially required GNU to work (initially Torvalds goal was to be compatible with minix instead of gnu, but that makes no difference here). The newline choice is unrelated to Linux because it was made a long time before Linux was written. There has been a lot of more or less gratuitous wacky choices in the various Linux releases, they didn't prevent Linux to be successful. One of the reasons likely being that many of these choices were revisited later. Commented Dec 31, 2017 at 23:52