How to use the common command comm in Linux
This article mainly introduces the Linux commonly used command comm how to use, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The Linux common command comm command is used to compare two sequenced files. This directive compares the differences between the two sorted files in a column and displays the results.
Syntax comm [- 123] [--help] [--version] [first file] [second file] parameter:
-1 does not display columns that have only appeared in the first file.
-2 does not display columns that have only appeared in the second file.
-3 does not display columns that have only appeared in files 1 and 2.
-help online help.
-version displays version information.
The file contents of instance aaa.txt and bbb.txt are as follows:
[root@localhost text] # cat aaa.txt aaa bbb ccc ddd eee 111222 [root@localhost text] # cat bbb.txt bbb ccc aaa hhh ttt jjj executes the comm command output as follows:
[root@localhost text] # comm aaa.txt bbb.txt aaa bbb ccc aaa ddd eee 111222 hhh ttt jjj the first column, the second column, the third column output contains only the columns that appear in the aaa.txt, the second column contains the columns that appear in the bbb.txt, and the third column contains the columns contained in both aaa.txt and bbb.txt. Each column is delimited by the tab\ t.
Thank you for reading this article carefully. I hope the article "how to use Linux commands comm" shared by the editor will be helpful to everyone. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!