Concept

Comm

Summary
The command in the Unix family of computer operating systems is a utility that is used to compare two for common and distinct lines. is specified in the POSIX standard. It has been widely available on Unix-like operating systems since the mid to late 1980s. Written by Lee E. McMahon, first appeared in Version 4 Unix. The version of bundled in GNU coreutils was written by Richard Stallman and David MacKenzie. reads two files as input, regarded as lines of text. outputs one file, which contains three columns. The first two columns contain lines unique to the first and second file, respectively. The last column contains lines common to both. This functionally is similar to . Columns are typically distinguished with the character. If the input files contain lines beginning with the separator character, the output columns can become ambiguous. For efficiency, standard implementations of expect both input files to be sequenced in the same line collation order, sorted lexically. The sort (Unix) command can be used for this purpose. The algorithm makes use of the collating sequence of the current locale. If the lines in the files are not both collated in accordance with the current locale, the result is undefined. Unlike , the return code from has no logical significance concerning the relationship of the two files. A return code of 0 indicates success, a return code >0 indicates an error occurred during processing. catfooapplebananaeggplantcat foo apple banana eggplant cat bar apple banana banana zucchini $ comm foo bar apple banana banana eggplant zucchini This shows that both files have one banana, but only bar has a second banana. In more detail, the output file has the appearance that follows. Note that the column is interpreted by the number of leading tab characters. \t represents a tab character and \n represents a newline (Escape character#Programming and data formats). In general terms, is a more powerful utility than . The simpler is best suited for use in scripts. The primary distinction between and is that discards information about the order of the lines prior to sorting.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.