<story><title>You shouldn&apos;t parse the output of ls(1)</title><url>https://mywiki.wooledge.org/ParsingLs</url></story><parent_chain><item><author>amptorn</author><text>Why in the world does Unix allow newlines in a filename in the first place? That&amp;#x27;s just such an obviously brain-damaged idea. There&amp;#x27;s not a single rational use case for it, yet it breaks nearly every text-based tool you could possibly imagine...</text></item></parent_chain><comment><author>marcosdumay</author><text>Why would Unix go and add random restrictions to filenames?&lt;p&gt;And what text protocol requires you to just insert user data without escaping or re-encoding? That looks badly broken. The kind of broken that will give your entire system to a hacker for encrypting and demanding ransom.</text></comment>
<story><title>You shouldn&apos;t parse the output of ls(1)</title><url>https://mywiki.wooledge.org/ParsingLs</url></story><parent_chain><item><author>amptorn</author><text>Why in the world does Unix allow newlines in a filename in the first place? That&amp;#x27;s just such an obviously brain-damaged idea. There&amp;#x27;s not a single rational use case for it, yet it breaks nearly every text-based tool you could possibly imagine...</text></item></parent_chain><comment><author>bayindirh</author><text>I&amp;#x27;m against limiting the character set allowed for file names. macOS is also in the same boat with Linux, going one step forward and allowing \null terminator even in the filenames.&lt;p&gt;If we&amp;#x27;re going to limit filenames&amp;#x27; character sets, I can offer a simpler solution:&lt;p&gt;Why allow file names? OS should provide a UUID for all files. No names, nothing. We can just write which file is what to another file, noting its UUIDs to sticky notes.</text></comment>