3 ms·
I learned, and thought everyone else learned, that the safe characters for POSIX filenames are: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678
by mmooss 27d ago
I learned, and thought everyone else learned, that the safe characters for POSIX filenames are:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-
That is, the only safe non-alphanumeric characters are dash "-" and underscore "_". Period "." is also considered 'safe' but is tricky for obvious reasons and [IMHO, for the most reliability] best avoided except where necessary.
Authoritative source: POSIX.1-2024 standard, sec. 3.265 Portable Filename Character Set
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265 https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1...
- edoceo 27d agoSometimes, if your file starts with a dash things can be tricky. Don't make any mistakes removing a file named '-fr'