Hi I am looking for a character in Unix and Windows filesystems that is not allowed in file and directory names and I was wondering if there is such a character (I have noticed that * and % are allowed)?
There is no such thing as a "Unix" filesystem. Nor a "Windows" filesystem come to that. Do you mean NTFS, FAT16, FAT32, ext2, ext3, ext4, etc. Each have their own limitations on valid characters in names.
Also, your question title and question refer to two totally different concepts? Do you want to know about the subset of legal characters, or do you want to know what wildcard characters can be used in both systems?
http://en.wikipedia.org/wiki/Ext3 states "all bytes except NULL and '/'" are allowed in filenames.
http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx describes the generic case for valid filenames "regardless of the filesystem". In particular, the following characters are reserved < > : " / \ | ? *
Windows also places restrictions on not using device names for files: CON, PRN, AUX, NUL, COM1, COM2, COM3, etc.
Most commands in Windows and Unix based operating systems accept * as a wildcard. Windows accepts % as a single char wildcards, whereas shells for Unix systems use ? as single char wildcard.
Most filesystems are fairly permissive: for example, all NTFS, extN, btrfs, XFS and ReiserFS allow everything except 1) the null byte and 2) the slash
The operating system may have its own restrictions. In particular, the Win320 API disallows
In Unix, wildcard expansion is done by the shell and by the
0 I have no information about the POSIX and OS/2 APIs offered by Windows.
1 They are special in the command line shell (
It really depends on the filesystem, but most of the Unix filesystems allow any byte except NULL and /. NTFS allows all except NULL and \ / : * ? " < > |.
There is an extremely helpful comparison chart on Wikipedia: http://en.wikipedia.org/wiki/Comparison_of_file_systems
That said, almost all shells recognize * as a wildcard first and a character in a filename only when escaped. Why wouldn't use use *?
I don't think either filesystem expressly forbids any character. It's quite possible to create filenames on ext2 or NTFS with names like