top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What difference between cmp and diff commands?

+3 votes
479 views
What difference between cmp and diff commands?
posted Feb 4, 2016 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

cmp

-Byte by byte comparision performed for two files comparision and displays the first mismatch byte.
-cmp returns the 1st byte and the line no of the fileone to make the changes to make the fileone identical to filetwo.
-Directory names can not be used.

diff

-Indicates the changes that are to be done to make the files identical.
-returns the text of filetwo that is different from filetwo.
-Directory names can be used

answer Feb 4, 2016 by Shivaranjini
Similar Questions
+1 vote

In my knowledge, both commands are used to get the details of Linux system. But I want to know the difference between these two and when to use which one ?

+3 votes

What are the commands to make a file hidden and to delete all hidden in the folder in Linux? Please explain in detail?

...