Tuesday, June 6, 2023
HomeAppleterminal - How you can get "ls" and "type" instructions to breed...

terminal – How you can get “ls” and “type” instructions to breed Finder.app sorting utilizing LC_COLLATE


In Apple Finder.app particular characters come earlier than numerals which then are adopted by alpha characters. It seems that is referred to as “Pure Type Order”

[
1
2
3
A
B
C

Using ls -f the bracket ends up after numerals and before alpha characters instead of at the beginning.

I have tried changing the locale in the shell without luck.

This is my locale:

0-zsh% locale                                  
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C"

These are possible english locale options

0-zsh% locale -a | grep -i en
en_NZ
en_US.US-ASCII
en_US.UTF-8
en_NZ.ISO8859-1
en_AU.US-ASCII
en_US
en_NZ.UTF-8
en_AU.ISO8859-15
en_US.ISO8859-15
en_NZ.ISO8859-15
en_AU.UTF-8
en_CA
en_NZ.US-ASCII
en_GB.ISO8859-1
en_CA.US-ASCII
en_CA.ISO8859-15
en_US.ISO8859-1
en_GB.UTF-8
en_GB.US-ASCII
en_AU
en_GB
en_CA.UTF-8
en_IE.UTF-8
en_CA.ISO8859-1
en_AU.ISO8859-1
en_IE
en_GB.ISO8859-15

https://www.engadget.com/2008-06-24-mac-101-finder-filename-sorting.html

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments