LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compare two files (https://www.linuxquestions.org/questions/linux-software-2/compare-two-files-398118/)

namit 12-31-2005 07:28 AM

Compare two files
 
What is the best program for it

I am using cmp but that does not seam to say line 2 is different to the other files

Just get EOF on etc/passwd-

mailman:# cmp /etc/passwd /etc/passwd-
cmp: EOF on /etc/passwd-


Anyone else have a program that comparies files. have to be able to use it in shell


"I do not have a gui"

gilead 12-31-2005 08:10 AM

The diff command may be what you need. It can report on the line by line differences between 2 text files. It only tells you whether or not the 2 files are different if they are binary though.
I usually use the -u switch which outputs in a format I prefer. However, -y outputs differences side by side which is also useful. Try the man page - if it doesn't explain it clearly, let me know


All times are GMT -5. The time now is 08:59 AM.