LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, Mint 18.1, Debian Jessie
Posts: 1,207

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
Posts: 1,880

Rep: Reputation: 51
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, Mint 18.1, Debian Jessie
Posts: 1,207

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
Posts: 1,880

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration