I just tried it on Mac, its sorted in the order you listed. Extending it a bit, the order is:
photo1 photo01 photo001 photo0001 photo2
So the shorter representation of the same number comes first. It does make intuitive sense to me.
photo1 photo01 photo001 photo0001 photo2
So the shorter representation of the same number comes first. It does make intuitive sense to me.
> photo1 photo01 photo001 photo0001 photo2
What you enumerated is known as "ascending lexicographical ordering" and has nothing to do with "the shorter representation of the same number", but instead the ASCII[0] character values in each file name.
0 - https://man.freebsd.org/cgi/man.cgi?query=ascii&apropos=0&se...
Good catch. I did not closely inspect the ordering initially presented, which was:
photo1 photo01 photo001 photo0001 photo2
This does not represent a valid sort order based solely on file names produced by `ls`, which would be: photo0001 photo001 photo01 photo1 photo2