1

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
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.