1.

When two files are identical, what is the output of diff command?(a) Files are identical(b) Returns prompt(c) No output(d) Throws an errorThe question was posed to me in an online interview.This question is from Comparing Files:comm, cmp and diff Command in portion Handling Ordinary Files of Unix

Answer»

The correct choice is (b) Returns PROMPT

The best explanation: When two files are IDENTICAL, diff command does not produce any output. It simply returns the SHELL prompt $. However, we can USE the -s option to display an informative message on the terminal if the files are identical.



Discussion

No Comment Found

Related InterviewSolutions