Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Modify sort ordering for `ls`



On 2017-08-18 at 13:32 -0700, Daniel Li wrote:
> Whereas on Ubuntu, ls -l gives the reverse:
> 
> -rw-rw-r-- 1 ubuntu ubuntu 0 Aug 18 13:22 VeryLongFileNameHelper.scala
> -rw-rw-r-- 1 ubuntu ubuntu 0 Aug 18 13:22 VeryLongFileName.scala

export LC_COLLATE=POSIX

1. The default sort ordering is driven by locale.
2. Zsh can do things about results of stuff driven by zsh, including
   glob expansion.
3. The above is not using zsh glob expansion.
4. How ls(1) works should be documented in its man-page and other than
   via the environment, Zsh can't do anything here.  There's no
   environment variables _we_ can add to _your_ system ls.

Ultimately, if you can't find a locale collation which works for your
purposes, you can dive deep and write your own collation specification.
If your OS allows use of private locale definitions, then these should
work in _all_ locale-aware applications, not just ls(1).

http://pubs.opengroup.org/onlinepubs/009696699/utilities/localedef.html
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/xbd_chap07.html



Messages sorted by: Reverse Date, Date, Thread, Author