ls像file manager的sort - Linux

Joseph avatar
By Joseph
at 2016-02-05T22:19

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

--
Tags: Linux

All Comments

Sarah avatar
By Sarah
at 2016-02-06T01:09
ls -f $(ls|sort -n)
Necoo avatar
By Necoo
at 2016-02-10T19:19
ls | sort -t_ -n -k 1 -k 2
Brianna avatar
By Brianna
at 2016-02-11T22:42
原來-k是可以重複帶的,2樓是我要的,謝謝你。

越來越好用的 Linux Mint 17

Daniel avatar
By Daniel
at 2016-02-04T14:24
當初發佈不久我就下載17.3版並做成Live-USB試用。開機過程一切順利,不過桌面有點 亮,因此很順手的按 fn+F5 來降低亮度,此時我才驚覺有什麼地方不對勁。 過去Linux令使用者卻步的問題有很多,複雜的安裝過程、硬碟的切割、軟體的相依性 與硬體的驅動程式,特別是特定筆電品牌的特殊功能鍵。 然而就 ...

mklabel用錯硬碟

Jacky avatar
By Jacky
at 2016-02-03T23:19
加了一顆硬碟,以為是SDD,卻是SDC.. SDD原本有加入LVM,被我parted mklabel loop了 試過rescue 還是看不到分割表 用lsblk: sda 8:0 0 2.7T 0 disk `-sda1 ...

這台迷你電腦拿來玩Linux的話?

Queena avatar
By Queena
at 2016-02-03T21:45
http://i.imgur.com/JoqPNKZ.jpg http://i.imgur.com/XcRb6dz.jpg 規格如上 想裝ubuntu來玩,不知是否合適? 本人是初學者~ -- Sent from my Android - ...

GCIN 無法更新或共享詞庫

Aaliyah avatar
By Aaliyah
at 2016-02-03T14:28
我使用 openSUSE Leap 42.1 的 GCIN 想更新詞庫卻出現以下訊息 cannot connect to hyperrate.com:443 請問這要如何處置? - ...

做win10/fedora雙開機,結果兩邊都壞了

Victoria avatar
By Victoria
at 2016-02-03T13:49
公司配了台筆電,是Win10,以前都是用mac,第一次用win10 看了youtube的雙開教學(BIOS設定legacy mode等等),做了fedora 23的開機usb, 裝好後重開機,結果現在兩邊都進不去了,開機後直接跳出開機選單 選and#34;windows boot managerand#34; ...