Here is the list of possible candidates:
Oct Dec Hex Name 040 32 0x20 space 041 33 0x21 !, exclamation mark 042 34 0x22 ", double quote 043 35 0x23 #, hash 044 36 0x24 $, dollar 045 37 0x25 %, percent 046 38 0x26 &, ampersand 047 39 0x27 ', quote 050 40 0x28 (, open parenthesis 051 41 0x29 ), close parenthesis 052 42 0x2a *, asterisk 053 43 0x2b +, plus 054 44 0x2c ,, comma 055 45 0x2d -, minus 056 46 0x2e ., full stop 057 47 0x2f /, oblique stroke
/ is reserved by FS. Space is hard to see. Quoting characters require awful quoting.
! is used for history expansion by shells in interactive mode.
# at the beginning of word is comment syntax in shell.
$ used for variable substitution in shells.
& is command separator in Windows CMD and control operator in shells.
) have special meaning in shells along with
+ are special in regex.
- is used as marker of comand argument. Usage of special agreement to supply file list after
-- or prefixing like
./- is common technique to allow
- as file prefix.
% should be quoted in URL and have special meaning in Windows CMD and environment variables.
Dot is safe as prefix in file name but solely
.. have special meaning for FS and it
should be qouted in regex.
The winner is comma
, although it is hard to distinguish from dot sign. You may see comma as
prefix in a Lisp special backquote syntax.
Some tools uses comma as field separator. For example in Ant build tools this:
<fileset dir="." includes="**/*,*.xml"></fileset>
should be replaced with:
<fileset dir="."> <include name="**/*,*.xml" /> </fileset>
, have special meaning when used in
Another pretty safe prefix is a plus sign except that it requires escaping in regex.
GNU Coreutils have utility that checks file names for safety:
$ cd $DIR $ pathchk --portability **/*
List of reserved characters prohibited in file names.
OS X: Cross-platform filename best practices and conventions.
Filename on Windows.
Is it correct to use certain special characters when naming filenames in Linux?
What characters are safe in cross-platform file names for Linux, Windows and OS-X.