Linux中的uniq命令(去掉重复项,输出重复项)
2024-09-01 04:11:27
ls /bin /usr/bin | sort | uniq | less
上面这条命令的实际效果是:
- 获得
ls /bin /usr/bin
的 output - 将上述 output 进行 sort (排序),并去掉重复项 (uniq)
- 将经过以上处理的 output 作为
less
命令的 input,输出在屏幕上
相反地,如果想输出重复项,使用以下命令:
ls /bin /usr/bin | sort | uniq -d | less
最新文章
- 【11-10】spring学习笔记-ApplicationContextAware
- Android编译过程中的碎碎念
- C#事件支持发布者/订阅者模式(观察者模式)
- JavaScript常用技巧总结(持续添加中...)
- [ 转] [Android]多式样ProgressBar
- Thinking in Java——笔记(5)
- css动画集合地址
- 反编译.net dll
- Beyond MySQL --Branching the popular database--转载
- handoff了解
- 06 MDB将数据和dataGridView1绑定
- Provisioning profile 浅析
- HTTP模拟工具【C#/Winform源码】、Json绑定TreeView控件、使用了MetroModernUI、RestSharp、Dapper.Net、Newtonsoft.Json、SmartThreadPool这几个主要开源框架
- Problem A: 让动物们叫起来吧!
- mybatis框架(4)---输入输出映射
- CentOS 7.0安装
- RuntimeError: Model class apps.users.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
- Python函数——命名空间与闭包
- Openlayer3之空间参考扩展
- 取消word中所有超链接
热门文章
- Milking Grid poj2185
- [CSP-S模拟测试]:引子(大模拟)
- leetcode 217. 存在重复元素 (python)
- 125、TensorFlow计算图的执行
- mysql.connector.errors.ProgrammingError: 1698 (28000): Access denied for user 'root'@'localhost'
- 配置最漂亮的PyCharm界面,Python程序员必备!
- 【ABAP系列】SAP ABAP中关于commit的一点解释
- 爬虫之requests 高级用法
- 利用三层交换机实现VLAN间路由(计算机网络中速率、带宽、吞吐量的概念)
- ";CoolShell puzzle game"; writeup