<p>在Linux和其他Unix相关系统中,只有两个字符不能出现在文件或目录的名称中,它们是NUL<code>'\0'</code>和slash<code>'/'</code>。当然,斜杠可以出现在路径名中,分隔目录组件。</p>
<p>据传Steven Bourne(属于shell)有一个包含254个文件的目录,每个文件名(当然,不包括<code>/</code>,<code>'\0'</code>;名称<code>.</code>是当前目录)中的字母(字符代码)对应一个目录。它被用来测试Bourne shell,并经常对备份程序等不小心的程序造成破坏。</p>
<p>其他人已经遵守了Windows规则。</p>
<p>注意,MacOS X有一个不区分大小写的文件系统。</p>
<p/><hr/>
<sup>1</sup>在第6章,测试,§6.5压力测试中,Kernighan&Pike在<a href="http://cm.bell-labs.com/cm/cs/tpop/" rel="noreferrer">The Practice of Programming</a>中也这么说:
<blockquote>
<p>When Steve Bourne was writing his Unix shell (which came to be known as the Bourne shell), he made a directory of 254 files with one-character names, one for each byte value except <code>'\0'</code> and slash, the two characters that cannot appear in Unix file names. He used that directory for all manner of tests of pattern-matching and tokenization. (The test directory was of course created by a program.) For years afterwards, that directory was the bane of file-tree-walking programs; it tested them to destruction.</p>
</blockquote>
<p><sup><em>请注意,目录中必须包含条目<code>.</code>和<code>..</code>,因此可以说是253个文件(和2个目录)或255个名称条目,而不是254个文件。这并不影响轶事的有效性,也不影响它所描述的仔细测试。</em></sup></p>