- Learning Linux Shell Scripting
- Ganesh Naik
- 102字
- 2021-06-25 22:02:50
The uniq command
The following are a few examples showing the usage of the uniq command:
- This command removes duplicate adjacent lines from the file:
$ cat test aa aa cc cc bb bb yy zz $ uniq test
- This output removes the duplicate adjacent lines from test file, shown as follows:
aa cc bb yy zz
- The next command only prints duplicate lines:
$ uniq -d test
- Output:
aa cc bb
- The following command prints the number of occurrences of all elements on an inpidual line:
$ uniq -c test
- Output:
2 aa 2 cc 2 bb 1 yy 1 zz
推薦閱讀
- 空間機器人遙操作系統及控制
- Visual FoxPro 6.0數據庫與程序設計
- 程序設計語言與編譯
- 網絡綜合布線技術
- 自動生產線的拆裝與調試
- 基于ARM 32位高速嵌入式微控制器
- Implementing Oracle API Platform Cloud Service
- 工業控制系統測試與評價技術
- 零起點學西門子S7-200 PLC
- Extending Ansible
- Hands-On Data Warehousing with Azure Data Factory
- Photoshop CS4數碼攝影處理50例
- 數據要素:全球經濟社會發展的新動力
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- Hadoop Beginner's Guide