I've noticed for a while now that, on some of the Unix-based systems I use at least, ls [A-Z]*
has been giving me the results I would anticipate from ls [A-Za-z]*
, leaving me unable to easily get a list of just the goddamned files that start with capital letters. I just now ran into the same thing with grep
, where I could not get it to stop matching lowercase letters with [A-Z]
until I eventually used grep -P
to get Perl regex.
So I have some related questions:
ls
and grep
cases? (Trying, for example, grep --no-ignore-case
was fruitless. grep -P
is not a very good workaround because of its experimental feature status.)It's actually [A-Za-y]
, and it has to do with language collation. If you want to override it then set $LC_COLLATE
appropriately; either of C
or POSIX
should do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With