当前位置:网站首页>Shell-sort命令的使用
Shell-sort命令的使用
2022-04-23 17:04:00 【魔笛Love】
sort
sort命令是在Linux里非常有用,它将文件进行排序,并将排序结果标准输出。
基本语法
sort (选项) (参数)
选项 | 说明 |
---|---|
-n | 依照数值的大小排序 |
-r | 以相反的顺序来排序 |
-t | 设置排序时所用的分隔字符 |
-k | 指定需要排序的列 |
参数:指定待排序的文件列表
案例实操
## 数据准备
[bd@localServer ~]$ touch sort.sh
[bd@localServer ~]$ vim sort.sh
bb:40:5.4
bd:20:4.2
xz:50:2.3
ww:10:3.5
ss:30:1.6
### 按照“:”分割后的第三列倒序排序。
[atguigu@hadoop102 datas]$ sort -t : -nrk 3 sort.sh
bb:40:5.4
bd:20:4.2
ww:10:3.5
xz:50:2.3
ss:30:1.6
版权声明
本文为[魔笛Love]所创,转载请带上原文链接,感谢
https://blog.csdn.net/clearlxj/article/details/121742606
边栏推荐
- Shell script -- shell programming specification and variables
- Detailed explanation of the penetration of network security in the shooting range
- Detailed explanation of Milvus 2.0 quality assurance system
- Milvus 2.0 質量保障系統詳解
- VLAN高级技术,VLAN聚合,超级Super VLAN ,Sub VLAN
- Log4j output log information to file
- Decimal format decimal / datetime conversion processing
- 【题解】[SHOI2012] 随机树
- Nodejs installation and environment configuration
- [registration] tf54: engineer growth map and excellent R & D organization building
猜你喜欢
Use between nodejs modules
Smart doc + Torna generate interface document
【WPF绑定3】 ListView基础绑定和数据模板绑定
The new MySQL table has a self increasing ID of 20 bits. The reason is
网络安全之渗透靶场实战详解
1-4 configuration executable script of nodejs installation
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey
ACL 2022 | DialogVED:用于对话回复生成的预训练隐变量编码-解码模型
Mock test using postman
Go language, array, string, slice
随机推荐
1-3 components and modules
Paging SQL
Aiot industrial technology panoramic structure - Digital Architecture Design (8)
MySQL master-slave replication
Grpc gateway based on Ocelot
文件操作《二》(5000字总结篇)
Use between nodejs modules
JSON deserialize anonymous array / object
【题解】[SHOI2012] 随机树
New keyword learning and summary
Website_ Collection
Zhongang Mining: Fluorite Flotation Process
面试百分百问到的进程,你究竟了解多少
Expression "func" tSource, object "to expression" func "tSource, object" []
El date picker limits the selection range from the current time to two months ago
Wiper component encapsulation
杂文 谈谈古典的《拆掉思维里的墙》
【WPF绑定3】 ListView基础绑定和数据模板绑定
Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
◰ GL shader handler encapsulation