2

How can I make mc sort files just lexicographically?

I have the following files in a directory

asn-gpD2360-time.pdf
asn-gp-time.pdf
asn-mggpD2360-time.pdf
asn-mggplcfD2360-time.pdf
asn-mggplcf-time.pdf
asn-mggp-time.pdf

and when I set sorting by name, I would expect them sorted like this

asn-gp-time.pdf
asn-gpD2360-time.pdf
asn-mggp-time.pdf
asn-mggpD2360-time.pdf
asn-mggplcf-time.pdf
asn-mggplcfD2360-time.pdf

This is how e.g. python does it:

>>> sorted(['asn-gpD2360-time.pdf', 'asn-gp-time.pdf', 'asn-mggpD2360-time.pdf', 'asn-mggplcfD2360-time.pdf', 'asn-mggplcf-time.pdf', 'asn-mggp-time.pdf'])
['asn-gp-time.pdf', 'asn-gpD2360-time.pdf', 'asn-mggp-time.pdf', 'asn-mggpD2360-time.pdf', 'asn-mggplcf-time.pdf', 'asn-mggplcfD2360-time.pdf']

Instead, mc sorts them as shown in the first list. Why? How can I make it sort like python does?


I've tried running it as LC_COLLATION=C mc, sorting by "version" and combination of both and I still get this weird sorting.

1
  • 1
    LC_COLLATE.
    – Quasímodo
    Commented Mar 16, 2021 at 12:19

1 Answer 1

5

Set in the window of MC "left (or right) - Sortorder - case sensitive".

You must log in to answer this question.

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