> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&'()+,-;=@[]^_`{}~
Yeah I definitely don't want any of those last ~22 characters in file names if I need to do anything with them from a shell
> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&'()+,-;=@[]^_`{}~
Yeah I definitely don't want any of those last ~22 characters in file names if I need to do anything with them from a shell
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...
I quite like base58 for human-presented identifiers also. I tend to use it instead of hex for having ~8-16 character IDs of things.
Even just the extra characters in base64 are often annoying and we already have multiple common base64 standards because even trying to find just two more characters to fill out a-zA-Z0-9 is hard.
Also on efficiency, you are trading off code complexity for a little extra storage: base64 is a nice round 6 bits per character meaning every three bytes encoded is four output. Neither base84 nor base58 align on convenient bit boundaries like that so choosing the output character is more faf. Padding could be more complicated too.
Now if you are looking at a per-character limit where the characters are multi-byte (say SSMS shortcuts which are limited to 32767 UCS2 characters) then some form of base4096 (12 bits per character so three 8-bit bytes to two output characters) might be useful. Yes, I have done this: putting a long analysis proc (a replacement for sp_help & friends) into a “shortcut” I was getting close to the 32K-char limit so compressed and base64ed the code and included an unpacker. This was more than enough to deal with the problem (TBH, just stripping comments would have done!) and simplified things in some ways as I no longer needed to escape quotes and such, but I went one step further played with writing a B4096 encoder because I like playing with that sort of silliness. I went with 4096 due to aligning nicely with 4-bit boundaries, and finding 4096 useable characters (avoiding control characters, undefined codes, and other unprintables) is easy. If the limit is actually 32767 or any Unicode characters (including those not in the UCS2 or UTF16 base plane set) then you could perhaps get even more daft though I'm pretty sure it is just 16-bit characters and not full Unicode.
You would be asking for a world of hurt to put your root filesystem in a case-sensitive volume though. All sorts of software and applications have silently relied on case-insensitivity for decades. You can sometimes fix it on a case-by-case basis, but sometimes you can't, and it's also annoying for it to happen in the first place. Better to have a separate case-sensitive volume just for the stuff you want to be case-sensitive.
I ran into it more than once back in the day when I used Mac OS X as my primary OS.
More generally -- case sensitivity is a conceptual nightmare in the Unicode era. Should Cyrillic or Greek be case-insensitive as well? Etc. Do you really want the full complexity of Unicode string handling in your file system?
I would suggest treating file names like raw bytes. On modern Linux, anything but NUL is valid.
And slash/!
Another weird thing in macOS:
$ mkdir Cased
$ cd cased
$ pwd
/Users/me/Downloads/cased
$ cd ../Cased && pwd
/Users/me/Downloads/Cased
So yeah I wish the FS defaulted to sensitive, even though I never rely on that. Not its job to normalize names. -L Display the logical current working directory.
-P Display the physical current working directory (all symbolic links resolved).
If no options are specified, the -L option is assumed.
In your example, using `-P` will show `Cased`.Interestingly, it wasn't designed to deal with case, but to select whether to resolve symbolic links:
$ cd /tmp
$ mkdir a
$ ln -s a b
$ cd b
$ pwd && pwd -P
/tmp/b
/tmp/ahttps://manpages.ubuntu.com/manpages/stonking/man1/pwd.1.htm...
My main concern is the loose matching that comes with it where you can refer to any file or folder using any case without issue
There are workarounds, and containerization is a better idea, but you asked why you might want this.
And I guess it relies on the 31 (32?) bit blocks, to make colisions unlikely for short filenames.
It was too long ago, so, I've forgotten the names, but I remember the saga with PHP escaping (and failing) SQL queries (some sort of sql_real_now_honest_real_escape_string() function or something like that).
Bash is a clusterfuck waiting to happen when it comes to file names, but not all shells would be at risk here. For example the shell I maintain would be fine because file names are tokenised like how variables are tokenised in SQL strings when using parametrised queries (to use your SQL/PHP example).
(Also for anything that needs to work on a shell script or whatever)
I roll my eyes every time some "super secure secret generator" gives me a password with &^%#$ that I need to use on a shell script. Thanks for making my life harder I guess
"oh but you just need to escape them" Yes please be my guest trying to deal with character escape whack-a-mole
"Escaping" should be something some graybeard is mumbling about.
Yet here we are in 2026, still having to be on the lookout for a wild /../
Even PowerShell is boilerplate, boilerplate galore.
This occurs now with LLMs too. It's a fundamental problem, of the problem description, not the implementation.
It's like the telephone networks of old. They eventually realized that that is not so good. The computer world is still in its analog telephone phase. ;-)
I don't care. I never cared. And every sane tool knows how to deal with it
Shut up and stop thinking we're still in the 70s