what is the difference between commmands cmp and diff?

Answer Posted / deepa rajendran

The cmp command compares two files, and (without options)
reports the location of the first
difference between them. It can deal with both binary and
ASCII file comparisons. It does a
byte-by-byte comparison.

But in diff compares two files, directories, etc, and
reports all differences between the two. It
deals only with ASCII files. It’s output format is designed
to report the changes necessary to convert
the first file into the second.

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do chown command do?

528


What is nr in awk command?

595


What is $0 bash?

641


What is .sh file?

614


What does #!/ Bin sh do?

584






Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

618


Explain how to use grep command to list find the records of a file containing 10 different strings?

591


Differentiate cmp command from diff command.

584


Who command in unix?

568


Which command is used to kill the last background job?

769


What is grep short for?

552


How do you grep a case insensitive?

536


Who invented grep?

648


Enumerate some of the most commonly used network commands in unix?

612


What are awk commands?

580