Unix 'ls' сортировка по имени - PullRequest
109 голосов
/ 18 мая 2009

Можете ли вы отсортировать список ls по имени?

Ответы [ 11 ]

0 голосов
/ 02 апреля 2017
In Debian Jessie, this works nice:

ls -lah --group-directories-first

# l=use a long listing format
# a=do not ignore entries starting with .
# h=human readable
# --group-directories-first=(obvious)
# Note: add -r for reverse alpha

# You might consider using lh by appending to ~/.bashrc as the alias:
~$ echo "alias lh='ls -lah --group-directories-first'" >>~/.bashrc
# -- restart your terminal before using lh command --
...