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 are the different types of shell scripting?

0 Answers  


How to redirect both standard output and standard error to the same location?

0 Answers  


What is bash used for?

0 Answers  


What is an inode block?

0 Answers  


What is wc in shell script?

0 Answers  






one folder contains lot of students name but I want to fetch hello with every student name individually using shell script

0 Answers  


What is the lifespan of a variable inside a shell script?

0 Answers  


What is a beat in a script?

0 Answers  


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

0 Answers  


What is shift command in shell script?

0 Answers  


What is a batch file used for?

0 Answers  


What makes c shell a more preferable option than the bourne shell?

0 Answers  


Categories