What args should be used to make ls group file in such a way?

0

I'd like to list files grouped in such a sequence: ALL hidden files, directories, and the rest sorted by extension. So I made an alias in .bashrc like this:

alias ll="LC_COLLATE=C ls -AlhF --sort=extension --group-directories-first"

However this fails to put all the hidden files at first, only ending up sorting extension first and dot files second.

Any one can help me to achieve the goal?

everwisher

Posted 2019-10-03T09:00:12.860

Reputation: 1

Answers

0

Works for me, but there is a catch: a .hidden file is sorted as a .hidden extension, while a .hidden.txt file is sorted as a .txt (ahead of others .txt, because the empty string is sorted ahead...).

xenoid

Posted 2019-10-03T09:00:12.860

Reputation: 7 552