Operating Systems Specialist MCQs 

By: Prof. Fazal Rehman Shamil

Solved MCQs of Operating Systems Specialist.

Comparing Files comm, cmp and diff Command MCQs

We can skip some initial bytes from both the files to be compared by using______
(A). -b option
(B). -i option
(C). -l option
(D). -n option
(E). None of these
Multiple Choice Question Answer: b


We use -b option with cmp command for printing the differing bytes in both files.
(A). True
(B). False
(E). None of these
Multiple Choice Question Answer: a


To work properly for the comm command, files specified must be sorted.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b


For displaying the differences between files, what command do we use?
(A). comm
(B). cmp
(C). diff
(D). differ
(E). None of these
Multiple Choice Question Answer: c


For producing multi-columnar output in diff command, what option do we use?
(A). -s
(B). -v
(C). -y
(D). -e
(E). None of these
Multiple Choice Question Answer: c


What command we can use If we are interested in knowing whether the two files are identical or not?
(A). cmp
(B). diff
(C). comm
(D). differ
(E). None of these
Multiple Choice Question Answer: a


If we want to suppress column 1 and column 2 in the output of comm Command, what command we will use?
(A). comm -1,-2
(B). comm -1-2
(C). comm -3
(D). comm -12
(E). None of these
Multiple Choice Question Answer: d


What will be the output of diff command, when two files are identical?
(A). Returns prompt
(B). Files are identical
(C). No output
(D). Throws an error
(E). None of these
Multiple Choice Question Answer: a


For comparing two files, what command do we use?
(A). diff
(B). comp
(C). cmp
(D). comm
(E). None of these
Multiple Choice Question Answer: c


If both the files are identical the exit status of cmp command is______
(A). 1
(B). 0
(C). 2
(D). undefined
(E). None of these
Multiple Choice Question Answer: b


For displaying a detailed list of mismatches, which option do use with cmp command?
(A). -l
(B). -b
(C). -f
(D). -a
(E). None of these
Multiple Choice Question Answer: a


Two sorted files line by line are compared by____
(A). cmp
(B). comm
(C). diff
(D). sort
(E). None of these
Multiple Choice Question Answer: b


For limiting the number of bytes to be compared, which option do use with cmp command?
(A). -f
(B). -l
(C). -n
(D). -b
(E). None of these
Multiple Choice Question Answer: c

Prof. Fazal Rehman Shamil