what is the difference between cmp and diff commands

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to print the first array element?

794


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

939


How do I run a .sh file on mac?

903


What are the advantages of using shell scripts?

814


How do I run a script on mac?

786


What are the different variables present in linux shell?

797


What are script files?

738


What are "c" and "b" permission fields of a file?

773


I have 2 files and I want to print the records which are common to both.

928


What is an inode block?

807


What is the default shell of solaris?

780


How to get the first line from a file using just the terminal?

830


What does chmod do?

765


What is the difference between grep and egrep?

839


What does echo $0 do?

758