what is the difference between cmp and diff commands

Answers were Sorted based on User's Feedback



what is the difference between cmp and diff commands..

Answer / supreetha

cmp--> shows the first difference in the files

diff--> shows all the differences in the files

Is This Answer Correct ?    17 Yes 4 No

what is the difference between cmp and diff commands..

Answer / srikanth

cmp - It will compare files byte by byte
Ex: cmp text text1
text text1 differ: byte 2, line 1

diff - It will compare files line by line
If there are any differences in the file. Then it will print
to stdout along with all lines

Is This Answer Correct ?    13 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What is a shell in operating system?

0 Answers  


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

0 Answers  


What language is bash written in?

0 Answers  


What is shell application?

0 Answers  


What are the default permissions of a file when it is created?

0 Answers  






What is the first line in every perl script called?

0 Answers  


What is sh in shell script?

0 Answers  


write a shell script that accepts name from user and creates a directory by the path name, then creates a text file in that directory and stores in it, the data accepted from user till STOP, displays the no. of characters stored in the file.Program stops if directory name is null

1 Answers  


How do I start a shell script?

0 Answers  


how did u debugging in unix/ linux platform ??( project Related)

2 Answers   Symphony,


How will you pass and access arguments to a script in linux?

0 Answers  


What does chmod do?

0 Answers  


Categories