This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| comm [2025/05/02 05:04] – ken | comm [2026/01/16 03:37] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== comm command in Linux with examples ===== | ===== comm command in Linux with examples ===== | ||
| - | |||
| The ‘comm’ command in Linux is a powerful utility that allows you to compare two sorted files line by line, identifying the lines that are unique to each file and those that are common to both. This command is particularly useful when you have lists, logs, or data sets that need to be compared efficiently. Here, we will explore the syntax, usage, options, and examples of the ‘comm’ command. | The ‘comm’ command in Linux is a powerful utility that allows you to compare two sorted files line by line, identifying the lines that are unique to each file and those that are common to both. This command is particularly useful when you have lists, logs, or data sets that need to be compared efficiently. Here, we will explore the syntax, usage, options, and examples of the ‘comm’ command. | ||
| Line 14: | Line 13: | ||
| \\ | \\ | ||
| < | < | ||
| - | '$comm [OPTION]... FILE1 FILE2'\\ | + | '$comm [OPTION]... FILE1 FILE2' |
| - | </ | + | </ |
| - | ‘FILE1’ and ‘FILE2′: | + | '' |
| - | ‘[OPTION]’: | + | ''' |
| - | **Example of the ‘comm’ Command**\\ | + | \\ |
| + | ==== Example of the ‘comm’ Command | ||
| Let us suppose there are two sorted files file1.txt and file2.txt and now we will use comm command to compare these two.\\ | Let us suppose there are two sorted files file1.txt and file2.txt and now we will use comm command to compare these two.\\ | ||
| **Displaying contents of file1** | **Displaying contents of file1** | ||
| Line 28: | Line 28: | ||
| Hemant | Hemant | ||
| </ | </ | ||
| + | \\ | ||
| **Displaying contents of file2** | **Displaying contents of file2** | ||