跳至主要內容

sort

Mr.Hope...小于 1 分钟

sort

sort 命令用于文本文件的排序。

下面是 example.txt 文件的内容。

f
b
c
g
a
e
d

执行 sort 命令对其进行排序。

$ sort example.txt
a
b
c
d
e
f
g

参数

-R 参数表示随机排序。

sort -R example.txt
b
d
a
c
g
e
f
评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.1.3