Linux 命令 - sort命令(排序)
简介
常用参数
- " -n " : 纯数字排序
- " -r " :倒叙
- " -u ":去掉重复
- " -o ":输出到指定文件
- " -t ":指定分隔符
- ” -k ": 指定排序的列
实例
[root@ test_sort]
> root:0:9
> linux:6:6
> redhat:4:8
> centos:7:2
> ubuntu:1:7
> linux:6:6
> EOF
[root@ test_sort]
- sort 命令将以默认的方式将文本文件的第一列以 ASCII 码的次序排列,并将结果输出到标准输出。
[root@ test_sort]
centos:7:2
linux:6:6
linux:6:6
redhat:4:8
root:0:9
ubuntu:1:7
[root@ test_sort]
[root@ test_sort]
centos:7:2
linux:6:6
linux:6:6
redhat:4:8
root:0:9
ubuntu:1:7
[root@ test_sort]
[root@ test_sort]
root:0:9
ubuntu:1:7
redhat:4:8
linux:6:6
linux:6:6
centos:7:2
[root@ test_sort]
[root@ test_sort]
centos:7:2
linux:6:6
linux:6:6
redhat:4:8
ubuntu:1:7
root:0:9
[root@ test_sort]
[root@ test_sort]
centos:7:2
linux:6:6
redhat:4:8
ubuntu:1:7
root:0:9
[root@ test_sort]