This page: How can I make "ls" show dotfiles first? lets me list hidden files first, but I also wish to sort non-hidden files by "extension" e.g. all filenames ending with ".png" come after those ending with ".jpg".
ls -X does that, but the hidden files are no longer listed first (I suppose because their names begin with ".", their whole name is treated as their extension).
Is there a way to list hidden files first, and then non-hidden files sorted by extension? I'd prefer it to be wholly contained in the ls command, so that I can add further flags when needed.
Thanks!