I am trying to find a way to get either the stock macOS ls or (more likely) the GNU ls a.k.a. gls to show my files & folders in case insensitive order.
All of my efforts have resulted in lowercase letters being sorted after the uppercase letters.
⚠️ There are lots of outdated answers which no longer work!
This same question was asked on this forum in October 2011 (and in August 2013 on Stack Overflow), but those answers no longer work on macOS in 2020.
What I've tried that does not work:
LC_COLLATEdoes not seem to have any effect. I have tried these variations:LC_COLLATE="en_US.UTF-8" LC_COLLATE="cs_CZ.ISO8859-2" LANG="en_US.UTF-8" LC_COLLATE="en_US.UTF-8"There was no noticeable effect at all.
Apparently
ls -forgls -Uused to work for HFS+, although the output was supposed to be "unsorted", but apparently somehow in HFS+ "unsorted" was ¿accidentally? ¿coincidentally? case-insensitive? I guess? Whatever the reason, it no longer works, presumably because we’re using APFS now.”Just pipe it through
sort -f!” was never really an answer, but someone always seems to suggest it anyway. I want to be able to use all of the other features ofls/glsincluding color and-Cwhich doesn’t work if we have to pipe through another command.
Is there some hidden method out there that I might have missed? Or does this functionality is actually not possible? The latter would seem extremely odd to me, but stranger things have happened, I guess.
P.S. - I use zsh as my default shell anyway, so if there’s a way to replicate this with zsh that would be OK too.
zshbut if I try it on an account without my .zshenv/.zshrc then it works. Will have to ask thezshfolks for some help figuring out why it's not working for me. Must be a conflict in one of my other settings. Thanks! – TJ Luoma Mar 02 '20 at 02:49