Landed here trying to get *files starting with lower case only* output from /bin/ls.
Using bash 4.3.8 on Ubuntu 14.04 I was perplexed to see both upper and lower case when doing:
$ /bin/ls [a-z]*
First I short circuited all my aliases by invoking /bin/ls. Then I tried various pattern incantations. I googled around and found several things to try, but nothing seemed to work (in bash anyway, it's trivial to do with grep or find).
Then I remembered an ancient incantation
from the old days with which I was frequently beaten over the head (by grey beards in charge) known as "RTFM", and I ended up learning about globasciiranges
, which made it work:
$ ( shopt -s globasciiranges; /bin/ls [a-z]* )
The snippet from the man page was:
$ man bash
[...] Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a range
expression; any character that falls between those two characters, inclusive, using the current
locale's collating sequence and character set, is matched. If the first character following the
[ is a ! or a ^ then any character not enclosed is matched. The sorting order of characters in range
expressions is determined by the current locale and the values of the LC_COLLATE or LC_ALL shell
variables, if set. To obtain the traditional interpretation of range expressions, where [a-d] is equiv‐
alent to [abcd], set value of the LC_ALL shell variable to C, or enable the globasciiranges shell
option. A - may be matched by including it as the first or last character in the set. A ] may be
matched by including it as the first character in the set.