- Learning Linux Shell Scripting
- Ganesh Naik
- 148字
- 2021-06-25 22:02:50
The comm command
The comm command shows the lines unique to file_1 and file_2 along with the common lines in them. We can use various options while using the command in the scripts:
$ cat file_1 Barack Obama David Cameron Narendra Modi $ cat file_2 Barack Obama Angela Markel Vladimir Putin $ comm --nocheck-order file_1 file_2 Barack Obama David Cameron Engela Merkel Narendra Modi Vladimir Putin
In the preceding example, we can see the following:
- The first column shows the unique lines in file_1
- The second column shows the unique lines in file_2
- The last column shows the content common to both files
The output shows that the unique lines in file_1 are David Cameron and Narendra Modi. The unique lines in the second file are Engela Merkel and Vladimir Putin. The common name in both the files is Barack Obama, which is displayed in the third column.
推薦閱讀
- 空間機器人遙操作系統(tǒng)及控制
- 計算機應用復習與練習
- 西門子S7-200 SMART PLC實例指導學與用
- 中國戰(zhàn)略性新興產(chǎn)業(yè)研究與發(fā)展·智能制造
- Hands-On Data Warehousing with Azure Data Factory
- Photoshop CS5圖像處理入門、進階與提高
- Hands-On Dashboard Development with QlikView
- 生物3D打印:從醫(yī)療輔具制造到細胞打印
- AVR單片機工程師是怎樣煉成的
- AMK伺服控制系統(tǒng)原理及應用
- 常用傳感器技術(shù)及應用(第2版)
- Learn Microsoft Azure
- 軟測之魂
- Hands-On Geospatial Analysis with R and QGIS
- SketchUp 2014 for Architectural Visualization(Second Edition)