1.

Which command compares two sorted files line by line?(a) cmp(b) diff(c) comm(d) sortThe question was posed to me in semester exam.The query is from Comparing Files:comm, cmp and diff Command topic in section Handling Ordinary Files of Unix

Answer»

Correct option is (c) comm

For explanation: comm COMMAND is used for comparing two sorted files line by line. When there is no option specified with comm command it PRODUCES three column output. For example, if we WANT to compare two files namely file01 and file02 then the first column will contain those entries which are unique to file01 whereas the SECOND column will contain those entries which are unique to file02. The third column will contain the ACTUAL information i.e. those entries which are common to both fil01 and file02.



Discussion

No Comment Found

Related InterviewSolutions