macOS Catalina - how to set up Finder to use file sorting logic same as ls command (alphabetical order, not "natural")? [duplicate]

Apple's Finder has been using "natural" sort order (where strings of digits are ordered as single characters) for file names for nearly 20 years, since OS X 10.0 There's no way to change it as far as I know. If you want the other kind of sort order, you have to use Terminal or a 3rd party app.


Essentially, Finder is treating the numbers up to the first letter as its sort criterion.

So, as far as Finder is concerned, the order is 'correct' for

  • 0
  • 2
  • 6
  • 298
  • 2655522

It is not considering the entirety of the name as a hexadecimal figure.

Based on your edit - terminal is 'wrong' - 6 is smaller than 2655522

It's still down to "if you want a computer to sort 'properly' give it leading zeroes".

I also made a test folder - the logic is perhaps awkward, but it is actually logical, for a given definition.

enter image description here

I think what Terminal is doing is sorting numbers like they were letters, so like e would sort after aabbaccd so 6 sorts after 2655522


Maybe you might not know this but there is another button in your toolbar that also sorts your files and sometimes overrides or conflicts with the "Finder" preference setting you have. Check it out and make sure it's set to "none"

enter image description here