3

I can't figure it out how to sort folders by name in Finder. The contents should look like this:

0629e7bc-8110-4db9-aaa9-b67b0b73743d
06a409e1-98c6-4bf4-afa4-c814f7899d82
0a3a5c12-e459-4aa0-b9cb-30b544013215
0c14581f-31d8-4961-a14f-11afc40e47f9
0fe8970c-6338-46ca-bc16-f7867b271480
129855c4-7dbe-4a9f-a100-28b1d3d02340
1522e288-8a81-4298-aefc-f334cb088a53
180d430b-76f9-401f-845a-cb395bc1eba0
1a01a936-bedf-4758-971a-d4886ee8d281
....

But instead it looks like this:

enter image description here

Here are my settings:

sorting

Grouping is turned off.

I think this is a bug. Grouping is turned off everywhere (grouping doesn't change anything here). I've deleted .DS_Store files. What else could I try to fix this?

I am running macOS Mojave 10.14.5 (18F132)

Even if I switch to another view, it does not work.

another screenshot

  • If it is a general folder, can you tell me where to find such files? Also @SteveChambers I am not able to find the ^ arrow in Finder. Can you provide a screenshot? Paste the screenshot in answer field, Copt imgur link, discard answer, paste here – ankiiiiiii Jun 19 at 15:39
  • 2
    This is sorting by name. Letters come before numbers in the sort order. – Shannon Jun 20 at 11:45
  • 1
    My understanding is that the command line (for example, ls) sorts by ascii value, while the Finder uses a non-computerized alphabetical/numeric sorting. I'm not aware of a way to change the sort order in the Finder in the way that you want. – David Rouse Jun 20 at 12:42
  • @ankiiiiiii I've made these folders, by generating folders based on random uuids. – Tamás Jun 24 at 9:20
  • 1
    @Tamás, It is not seen by Finder as a "2" but as a "27". – Dave Nelson Jun 24 at 12:29
2

I think this is alphabetical vs natural search order being used in Terminal(or wherever the code block comes from) and Finder respectively, as pointed by Shannon and David.

Why is a folder which starts with a 2 on the bottom?

Because it is 27 which is treated as a block while sorting and is greater than other single numbers which are also being treated as blocks. Another example is in the longer screenshot. 5f comes before 06a as 5 is smaller than 06.

Numbers are smaller than alphabets in both cases.

In the code block, we have character-wise sorting where single digits are being compared. So a larger number like 062 sometimes comes before 06a as 2 is smaller than a.

For example, in alphabetical sorting "z11" would be sorted before "z2" because "1" is sorted as smaller than "2", while in natural sorting "z2" is sorted before "z11" because "2" is sorted as smaller than "11".

Alphabetical sorting:

z11

z2

Natural sorting:

z2

z11

Functionality to sort by natural sort order is built into many programming languages and libraries

https://en.wikipedia.org/wiki/Natural_sort_order

  • but everyone on the internet says, that sorting by name means sorting alphabetically. example macworld.com/article/3056182/… "Clicking the Name field at the top of the list view. An upward-pointing arrow following Name indicates sorting alphabetically with numbers first, then A to Z;" – Tamás Jun 24 at 10:11
  • 1 They are talking about arranging files and are not worried about the complexities that are there in sort. 2 They are right too, in a narrow case. with numbers first. Yes that is what I edited too. Numbers are smaller in both cases than alphabets. Difference comes in two numbers when they are have different digits. – ankiiiiiii Jun 24 at 10:15
  • so is it possible to sort files in the finder the same way as ls -la does in the terminal? – Tamás Jun 24 at 11:08
  • 2
    I believe this is the correct answer, it is sorting number as complete numbers and not as individual characters. It has been this way since Mac OSX. – Dave Nelson Jun 24 at 12:09
  • 2
    You shouldn't assume that documentation is wrong just because it's old. If the underling code is the same, then the documentation is still relevant. Since you asked... officially documented and current. developer.apple.com/library/archive/documentation/… – Shannon Jun 25 at 12:44
0

If you tap on the "Name" column header once, does it change?

In the attached screen shot the red arrow points to the name header in a Finder "show in a list" window. The yellow arrow points to the direction (arrow) of the sort, up or down. Finder List window showing sort options

Note that you can sort by any column by clicking on the column heading.

If it is better but reverse order, tap it again and the "^" at the right end of the name column will change direction and sort order.

  • nope, it does not sort it properly. – Tamás Jun 24 at 9:16
  • I've added a new screenshot, showing the tiny arrow next to the name column. The sort order is reversed (as it should) when I click it. But it still does not sort properly. – Tamás Jun 24 at 9:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .