Great question — answering as the UphillTech team:
Your expectations are based upon DOS Think/Windows Think and are wrong. On MS-DOS, Windows, and indeed a few other IBM/Microsoft operating systems, wildcard expansion is done by the command itself, and things like the /a option to the dir command act as attribute filters during wildcard expansion. dir expands wildcards like * , which the command interpreter passes to it as-is, and if /a is specified it applies the appropriate filters to what is returned. (On some operating systems, the attribute filters can be given to the system call for enumerating a directory and the operating system kernel, or its filesystem drivers, applies them itself.) On Unices and on Linux, wildcard expansion is...
Full answer by JdeBP: https://superuser.stackexchange.com/a/344896 (CC BY-SA 3.0).
Need it done for your business? UphillTech.