linux怎么去重统计


当前第2页 返回上一页

1

2

3

4

5

$ sort test.txt | uniq -c | sort -rn

4 Hello World.

2 The Iphone of Apple company.

2 Apple and Nokia.

1 My name is Friendfish.

每行前面的删除重复次数。

cut命令可以按列操作文本行。可以看出前面的重复次数占8个字符,因此,可以用命令cut -c 9- 取出每行第9个及其以后的字符。

1

2

3

4

5

6

$ sort test.txt | uniq -c | sort -rn | cut -c 9-

Hello World.

The Iphone of Apple company.

Apple and Nokia.

My name is Friendfish.

I wanna buy an Apple device.

以上就是linux怎么去重统计的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

如何通过控制台查看所拥有的所有ecs实例

Linux find命令的用法有哪些

Linux中无法挂载移动硬盘

Linux使用grep过滤多个条件的写法

如何使用deletenetworkinterface快速简单的删除弹性网卡

Linux怎么编译

Linux改变文件所有者命令是什么

Linux下查看目录的命令是什么

调用该接口时如何扩容一块数据盘

使Linux grep的输出不换行的方法有哪些

更多相关阅读请进入《Linux》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...