Linux - Difference between cmp and diff commands

What is the difference between cmp and diff commands? Provide an example for each.

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
Linux - What is the use of ‘grep’ command? Provide an example
What is the use of ‘grep’ command? - Grep stands for regular expression. ‘grep’ command is used to find the patterns in a text file provided by the user.......
Linux - Difference between cat and more command
Difference between cat and more command - The file contents are displayed by ‘cat’ command.........
Linux - What is ‘du’ command? What is its use?
What is ‘du’ command? What is its use? - The du (disk usage) command is used to report the size of directory trees......
Post your comment