Making directories list first in terminal with `ls`
Is it possible to make the default of Terminal such that when I use the ls
command it lists the directories first and then the files?
I figured out that this can be done by using coreutils
and the command gls --group-directories-first
, but I was wondering if there was an OS X native way to do this without coreutils
.
Solution 1:
The short answer is no. The ls
shipped with OSX is not the GNU ls
therefore it doesn't have the same options.
But you can get a similar result with :
ls -al | sort -k1 -r
Ps: I agree that it's far from perfect :)