default-settings
default-settings copied to clipboard
Make Bash ls match Files sorting
Migrating an issue report from Terminal.
It looks like the recommended way to do this is to create an alias. Maybe something like:
ls --color -h --group-directories-first
This will not address the sort order of hidden files, though. I think bash follows the current LC_COLLATE setting? But Files overrides this and always sorts files whose names begin with "." after other characters. If this is not the desired behaviour then an issue should be raised against Files.
So it looks like in order to make Terminal match Files for dot files we'd have to patch whatever provides /usr/share/i18n/locales/iso14651_t1_common to something like this where instead of having "ignore" we need to tell LC_COLLATE which character dot comes after. It would be nice if they matched, but it sounds complicated.
I think Files behavior here is probably as we expect :)
You could also consider using an alternative for ls, two examples that come to my mind are ls-go and exa. The screenshot below show ls-go with the exact search order you expect if I'm correct.
The alias in my shell-config for the above behaviour is [[ -x $GOPATH/bin/ls-go ]] && alias ls=ls-go\ -SL
Good idea @neur0manc, but I don’t think users have a $GOPATH by default.
@jwinnie [[ -x /usr/local/bin/ls-go ]] && alias ls=ls-go\ -SL would be the real life example if they were considering using ls-go.
Gonna punt since this is an enhancement not a release blocker