What Does Comm Do in Linux?

What Does Comm Do in Linux?
Contents

The comm command compares two sorted files line by line and writes three columns to standard output. These columns show lines that are unique to files one, lines that are unique to file two and lines that are shared by both files. It also supports suppressing column outputs and comparing lines without case sensitivity.

What is the use of comm command?

The comm command in the Unix family of computer operating systems is a utility that is used to compare two files for common and distinct lines. comm is specified in the POSIX standard.

What is difference between comm and CMP command in Linux?

Different ways of comparing two files in Unix

#1) cmp: This command is used to compare two files character by character. Example: Add write permission for user, group and others for file1. #2) comm: This command is used to compare two sorted files.

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.