LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-25-2005, 10:21 PM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu
Posts: 1,185

Rep: Reputation: 47
How do I compare 2 files?


I'd like to compare 2 config files for 2 kernels to see what the differences are. These are 2 text files. How would I do this?
 
Old 03-25-2005, 10:32 PM   #2
2Gnu
Senior Member
 
Registered: Jan 2002
Location: Southern California
Distribution: Slackware 14.0
Posts: 1,874

Rep: Reputation: 49
Try this: http://sourceforge.net/projects/tkdiff/

It works very nicely, clearly pointing out the differences between two files.
 
Old 03-25-2005, 10:34 PM   #3
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
diff -au file1 file2
 
Old 03-25-2005, 10:55 PM   #4
DyeKid
Member
 
Registered: Apr 2003
Distribution: Slackware 10.2 (AMD64 Desktop, HP ZV5120US & IBM T20 Laptops) Suse 10.1 (IBM T23 Laptop)
Posts: 58

Rep: Reputation: 15
Kompare?

If you use KDE, you could also use the diff/patch frontend Kompare. It's under the K > Development menu
 
Old 03-25-2005, 11:16 PM   #5
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu
Posts: 1,185

Original Poster
Rep: Reputation: 47
Thanks for all the advice on diff and tkdiff. From terminal I did this:

diff -au config-2.4.29 config-2.6.11 > config-diff

This gave me file config-diff that's a pretty big differences file (3587 lines). Are these lines matched up in similitude...are lines that are close in similarity to another compared?
 
Old 03-26-2005, 12:59 AM   #6
2Gnu
Senior Member
 
Registered: Jan 2002
Location: Southern California
Distribution: Slackware 14.0
Posts: 1,874

Rep: Reputation: 49
That's what I like about tkdiff. Both files are shown side by side in a split window with the differences highlighted in color. I used it exactly for the same purpose - to find out what differences existed between two kernel configs when I had a problem with a new kernel.

I usually favor a strict command line for most things, but in this case the GUI works.
 
Old 03-26-2005, 01:54 AM   #7
badinode
LQ Newbie
 
Registered: Mar 2004
Distribution: gentoo/fedora
Posts: 1

Rep: Reputation: 0
I like sdiff in a terminal window for this type of problem,

something like this:
sdiff -s config.a confgi.b

explain:
this suppresses the common lines of both files, and lets you see side by side the differences between the two.

man sdiff when in doubt..

HTH

badinode
 
  


Reply


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
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
how to compare 2 text files by using php code antony_csf Programming 3 10-14-2004 05:52 AM
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 03:14 PM.

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