'echo [A-Z]*' matches lower-case filenames as well?
That's because the glob pattern [A-Z]
does not generally correspond to uppercase letters. Specifically it expands according to
the current locale's collating sequence and character set
If you want files starting with an upper case letter, you can use
echo [[:upper:]]*
or set the locale explicitly
(LC_COLLATE=C; echo [A-Z]*)
or use the bash globasciiranges
shell option
(shopt -s globasciiranges; echo [A-Z]*)
See the Pattern matching
section of man bash