ls像file manager的sort - Linux

Table of Contents

我想用ls列出像是file manager預設的sort的樣子,像是:

0_0.txt
0_1.txt
0_2.txt
.
.
.
0_10.txt
0_11.txt
.
.
.
0_15.txt
1_0.txt
1_1.txt
.
.
.
15_15.txt

單純用sort -n好像沒用,我也google不到好的關鍵字
有請鄉民們提供見解


附上example:

for i in {0..15}
do
for j in {0..15}
do
touch $i"_"$j".txt"
done
done

--

All Comments

Sarah avatarSarah2016-02-06
ls -f $(ls|sort -n)
Necoo avatarNecoo2016-02-10
ls | sort -t_ -n -k 1 -k 2
Brianna avatarBrianna2016-02-11
原來-k是可以重複帶的,2樓是我要的,謝謝你。