1.

Which command is used for comparing two files?(a) cmp(b) comp(c) diff(d) commThe question was asked in an online interview.I want to ask this question from Comparing Files:comm, cmp and diff Command in section Handling Ordinary Files of Unix

Answer»

The correct option is (a) cmp

The BEST explanation: cmp command is used for comparing two files byte by byte. It displays the first mismatch and its location on the terminal. It does not bother about subsequent mismatches but displays only the first mismatch. As soon as the first DIFFERENCE is found, the command terminates and outputs the LINE and byte in which there is a difference. For example,



Discussion

No Comment Found

Related InterviewSolutions