Why is the terminal case-sensitive?
Ultimately, it was an arbitrary choice made by the creators of Unix over four decades ago now. They could have chosen to make things case-insensitive like the creators of MS-DOS did a decade later, but that has its disadvantages, too.
It's too deeply embedded in *ix culture to change now. The case sensitive filesystem issue brought up by eppesuig is only part of it. macOS systems — which are Unix-based — typically have case-insensitive (but case-preserving) file systems, so on such systems commands external to the shell are in fact treated case-insensitively. But, builtins like cd
remain case-sensitive.
Even with a case-insensitive filesystem, the history of things conspires against your wishes, Hussain. If I type ls
on my Mac, I get a colorized directory listing. If I type LS
instead, /bin/ls
still runs, but the listing isn't colorized because the alias that adds the -C
flag is case-sensitive.
Best just get used to it. If you can, learn to like it.
This is not a "terminal" problem, it is a file system feature. How should the shell look for your commands on the (always case sensitive) file system?
The technical systems that I use and respect are almost exclusively case-sensitive: be it OS or programming language or anything else.
The exceptions I could think of right now is the HTML tags and some implementations of SQL, and the Ada programming language.
Even in those cases, I think there are strong tendencies to actually write HTML tags in lowercase, and the SQL query semantics in uppercase (and parameters capitalized). (Correct me if I'm wrong.) As for Ada, the Emacs mode will correct you if you for example type a lowercase procedure name, although that won't matter when compiling. So, even when there is case-insensitiveness, it seems people agree it's a bad idea.
The reason is that you get much more expressive power with case-sensitiveness. Not only quantitatively - CD
is one, but CD
, Cd
, cD
, and cd
are four - but more importantly, you can express purpose, emphasis, etc. using upper- and lowercase sensibly; also, when programming, you'll enhance readability.
Intuitively, it is clear that you don't read hi
and HI
the same way!
But, to give you a computer world example, in the programming language Ada (from the 1980s), the first line of a procedure code block could look like this:
procedure body P(SCB : in out Semaphore_Control_Block) is
as you see, the procedure and parameter names are capitalized, as are datatypes, everything else is lowercase. Also note that the "all uppercase" parameter name tells us that it is an acronym. Now, compare this to
procedure body p(scb : in out semaphore_control_block) is
This is possible, as Ada is case-insensitive (or, to be exact, the compiler will change it to the way in my first example, but of course won't change your code). Or, how about:
PROCedure body P(Scb : IN Out semaphore_CONTROL_BLOCK) iS
That one is a bit ridiculous, I know; but someone would be stupid enough to write it that way (well, perhaps not). Point is, a case sensitive system will not only force people to be consistent, they will also be helped by it (readability) and use it to their advantage (the acronym example above).