Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-31-2005, 07:28 AM   #1
Registered: Aug 2005
Distribution: Debian
Posts: 355

Rep: Reputation: 30
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"
Old 12-31-2005, 08:10 AM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare 2 files? linuxhippy Slackware 6 03-26-2005 01:54 AM
Diff compare 2 files DavidTempler Linux - Newbie 2 11-01-2004 10:00 AM
Compare two cvs files.... trey85stang Linux - General 3 10-23-2004 08:05 PM
I'm looking for a perlscript to compare size of 2 files cccc Programming 5 02-28-2004 04:45 PM
to compare the contents of 2 files MaleWithBrains Linux - Newbie 3 01-27-2004 06:39 PM

All times are GMT -5. The time now is 01:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration