当前位置:网站首页>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
边栏推荐
- Copy constructor shallow copy and deep copy
- Promise (IV)
- Baidu Map 3D rotation and tilt angle adjustment
- Bytevcharts visual chart library, I have everything you want
- Camtasia2022软件新增功能介绍
- freeCodeCamp----prob_ Calculator exercise
- Regular filtering of Intranet addresses and segments
- Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
- Baidu Map Case - Zoom component, map scale component
- VsCode-Go
猜你喜欢
On lambda powertools typescript
How much do you know about the process of the interview
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation
Nacos + aspnetcore + Ocelot actual combat code
Mock test using postman
Grpc gateway based on Ocelot
Nifi fast installation and file synchronization
Smart doc + Torna generate interface document
Nodejs reads the local JSON file through require. Unexpected token / in JSON at position appears
随机推荐
ACL 2022 | DialogVED:用于对话回复生成的预训练隐变量编码-解码模型
PHP高效读大文件处理数据
Nifi fast installation and file synchronization
Derivation of Σ GL perspective projection matrix
如何用Redis实现分布式锁?
PyMySQL
拷贝构造函数 浅拷贝与深拷贝
Summary of common websites
_ Mold_ Board_
1-4 configuration executable script of nodejs installation
Further study of data visualization
Expression "func" tSource, object "to expression" func "tSource, object" []
自定义my_strcpy与库strcpy【模拟实现字符串相关函数】
Read a blog, re understand closures and tidy up
Paging SQL
Talk about browser cache control
MySQL restores data through binlog file
Log4j output log information to file
Dancenn: overview of byte self-developed 100 billion scale file metadata storage system
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation