I seems like it is possible to create filenames in unix with just about any valid character.touch \; &&touch \\ &&touch \ &&touch $'\n' &&touch $'\t' &&touch $'\v' &&touch $'\23' &&touch $'\13' &&echo DONE!The only characters I have found that does not work are / and NUL:touch /touch $'\0'Are there any other characters that are invalid or impossible to use in filenames?
What characters are valid to use in filenames?
files;filesystems;filenames;namespace
The answer is: in Unix-like systems, file names are composed of bytes, not characters. At least from perspective of the kernel and its API.A Unix-like kernel is normally neutral about any byte value but \000(ASCII: NUL) and \057(ASCII: slash). In Linux there are no other restrictions at the filesystem layer, but certain FS drivers and certain their modes lead to rejection of some names, usually due to impossibility of translation. For example, one cant create a filename with invalid UTF-8 on anything mounted with -o iocharset=utf8 (e.g. types cifs or vfat). None of DOS/Windows-compatible FSes will allow you to make \134(ASCII: backslash) a part of name. Or the msdos type will apply DOS restrictions concerning 8.3 names.Ext3/ext4 isnt known to have restrictions but aforementioned \000 and \057.