当前位置:网站首页>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
边栏推荐
- . net cross platform principle (Part I)
- 面试百分百问到的进程,你究竟了解多少
- Some problems encountered in recent programming 2021 / 9 / 8
- 博士申请 | 厦门大学信息学院郭诗辉老师团队招收全奖博士/博后/实习生
- Decimal format decimal / datetime conversion processing
- 蓝桥杯省一之路06——第十二届省赛真题第二场
- [registration] tf54: engineer growth map and excellent R & D organization building
- Summary of common websites
- Zhimeng dedecms security setup Guide
- PostgreSQL列存与行存
猜你喜欢
Use between nodejs modules
Detailed explanation of Niuke - Gloves
Milvus 2.0 质量保障系统详解
Bytevcharts visual chart library, I have everything you want
Nacos + aspnetcore + Ocelot actual combat code
org. apache. parquet. schema. InvalidSchemaException: A group type can not be empty. Parquet does not su
批量制造测试数据的思路,附源码
Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey
Getting started with JDBC
随机推荐
Lock lock
Further study of data visualization
Paging SQL
Lock锁
[PROJECT] small hat takeout (8)
vscode如何比较两个文件的异同
◰ GL shadow map core steps
扫码登录的原理你真的了解吗?
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey
. net cross platform principle (Part I)
信息摘要、数字签名、数字证书、对称加密与非对称加密详解
Calculate pie chart percentage
Website_ Collection
Linux MySQL data timing dump
Wiper component encapsulation
1-5 nodejs commonjs specification
Further optimize Baidu map data visualization
1-4 configuration executable script of nodejs installation
AIOT产业技术全景结构-数字化架构设计(8)
Redis docker installation