Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a programming challenge I need a filesystem which supports newline characters in filenames, so a file can be named something like:


I can't find any. Can anyone help me?

share|improve this question
I can think of nothing but problems with this. How would you access the file over a CLI? A\nfilename...? Icky! – Phoshi Apr 10 '10 at 13:56
The only bytes most Unix file systems do NOT allow in file names are slash (/), which separates directory and file names in a path, and NULL (\000), which indicates the end of the name. You can get interesting problems, though, with various programs that are not expecting nonprinting characters like backspace in a file name. – mpez0 Apr 10 '10 at 15:17
Mac OS X does support slashes :) – Bassie May 5 '10 at 22:13
Mac OS X supports slashes as part of the file name in the GUI, but it does it by translating them into colons when converting from the traditional Mac paths. Colons on the other hand, which Macs traditionally use to separate path components get translated to slashes. A folder called 27/January on a disk called External would appear as External:27/January in the GUI, but that gets converted into the POSIX path /Volumes/External/27:January – Andrew Turner Dec 25 '11 at 21:01
up vote 4 down vote accepted

Most Unix file systems allow for this. But you will often run into trouble with various programs and scripts that won't know how to handle it. If you do

date > 'test-
ls -lbd test*

Then you will see a \n in the file name which is a newline.

share|improve this answer
When Steve Bourne was testing his shell, he had a directory with 254 single-character file names in it - and it wrought havoc on programs that were not expecting such characters in file names. – Jonathan Leffler Apr 11 '10 at 4:07

You can find a list of the file naming rules for most operating systems at this link.

Maybe that will help you. I don't see explicitly something about new line characters, though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.