Linux [Electronic resources]

Janet Valade

نسخه متنی -صفحه : 357/ 282
نمايش فراداده

comm (compare two sorted text files)

Compares two sorted text files. Displays the results in three columns: 1) lines that are only in file1, 2) lines that are only in file2, and 3) lines that are in both files.

Format: comm

file1 file2 Examples: comm report1 report2

The differences are displayed, as shown below.

cat report1 Apples Peaches Pears

cat report2 Apples Cherries Pears

comm report1 report2 Apples Peaches Cherries Pears

The output shows Apples and Pears in both files. It shows Peaches only in the first file and Cherries only in the second file.