LinuxQuestions.org
Help answer threads with 0 replies.
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 07-02-2012, 07:27 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
A more friendly program than diff?


Hi:
I have Slackware 12.0 installed on my machine. Is there a more friendly cli program than the diff command for comparring two text files? I understand that diff is mainly to make patches. I ask in this subforum because it may be I have one in my distribution disks and don't know it.
 
Old 07-02-2012, 07:41 PM   #2
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
sdiff and vimdiff are both nice (I prefer vimdiff but I already use vim). I also prefer `diff -u` to `diff` for whatever reason...it's just easier to read. comm is useful for making comparisons as well, though it serves a different purpose. There's also mcdiff for an ncurses-based diff.

[edit] mcdiff may not exist in Slackware 12.0; sorry about that. [/edit]

Last edited by T3slider; 07-02-2012 at 07:45 PM.
 
3 members found this post helpful.
Old 07-02-2012, 07:46 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Most of the time I use 'diff -urN' but for comparison 'diff --width=$COLUMNS --side-by-side <(nl /some/file.orig) <(nl /some/file)|less' comes in handy. Maybe it's just me but I never felt I needed something else. What does "friendly" actually mean here? What exactly are you looking for?
 
Old 07-02-2012, 07:50 PM   #4
bosth
Member
 
Registered: Apr 2011
Location: British Columbia, Canada
Posts: 304

Rep: Reputation: 127Reputation: 127
There's colordiff, although I rarely remember to call it instead of plain diff. There's also the graphical kdiff3, but I never got used to it either.
 
Old 07-02-2012, 08:24 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
http://meldmerge.org/
 
Old 07-02-2012, 08:40 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by T3slider View Post
sdiff and vimdiff are both nice (I prefer vimdiff but I already use vim). I also prefer `diff -u` to `diff` for whatever reason...it's just easier to read. comm is useful for making comparisons as well, though it serves a different purpose. There's also mcdiff for an ncurses-based diff.

[edit] mcdiff may not exist in Slackware 12.0; sorry about that. [/edit]
Thank you so much T3slider. I'll look for them with
grep -irl <prog_name> /var/log/packages.

@unSpawn:
Most of the time I use 'diff -urN' but for comparison 'diff --width=$COLUMNS --side-by-side <(nl /some/file.orig) <(nl /some/file)|less' comes in handy. Maybe it's just me but I never felt I needed something else. What does "friendly" actually mean here? What exactly are you looking for?

I do not know how to express myself concisely. So, here you are: I had a little program, by name dbEdit, and I used to run it under MS-DOS 5.00. If two texts had few differences (two text files), I loaded both files into dbEdit (two buffers) and then, with a single stroke at a key ('n') I flipped back and forth between them. In the presence of the slightest difference between two screenfuls, you could tell at once.

This was really handy for me when the newer version of a program did not work. Friendly was perhaps not the appropriate word to use, because there is documentation in the form of an info file which is almost a tutorial. The truth is I am always saying: "it's imperative to learn diff", and I never find time to do it. But that its main purpose is the patch related stuff is true, is it not?

As to diff in itself, if you only tell me what's the meaning of the line consisting of three dashes when you use diff without any options, it will greatly enhance my understanding of the output, for I do not find it explained anywhere.

Another thing: is nl an external command or a builtin one? I do not seem to have it. Thanks for your reply. And thank you Richard Cranium too.
 
Old 07-02-2012, 08:58 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by T3slider View Post
sdiff and vimdiff are both nice (I prefer vimdiff but I already use vim). I also prefer `diff -u` to `diff` for whatever reason...it's just easier to read. comm is useful for making comparisons as well, though it serves a different purpose. There's also mcdiff for an ncurses-based diff.

[edit] mcdiff may not exist in Slackware 12.0; sorry about that. [/edit]
T3slider, this is manna from Heaven. I never knew I had these things!

Last edited by stf92; 07-02-2012 at 09:07 PM.
 
Old 07-02-2012, 11:07 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
If you're into the KDE desktop environment, try the kompare command. It's like the kdiff3 mentioned above, but - for my needs and taste - much easier to use.

On the other hand, if you're into non-windowed systems, emacs has been doing compares, merges, etc., for the last fifty years or so. Among other things.
 
1 members found this post helpful.
Old 07-03-2012, 12:23 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
(Hangs head in shame)

Quote:
Originally Posted by PTrenholme View Post
On the other hand, if you're into non-windowed systems, emacs has been doing compares, merges, etc., for the last fifty years or so. Among other things.
I should have written that. Well done!
 
Old 07-03-2012, 02:05 AM   #10
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
Yes - I know you said a CLI program, but even so, I have to mention a GUI program called 'diffuse', which is python-based, and I see it's recently arrived in slackbuilds. As a professional programmer of some 30+ years, I have to say that I find this one of the easiest to use.
 
Old 07-11-2012, 05:22 AM   #11
Exeunt
LQ Newbie
 
Registered: Feb 2007
Location: Horsham, PA
Distribution: Slackware 12.2, 14, Current
Posts: 18

Rep: Reputation: 1
Hi All,

I use diff from the command line a lot, but occasionally I like to use xxdiff which presents a very nice side-by-side view of the two files. I don't have any prejudice against a GUI application if it works well.

Exeunt

Slackware user since 1995
 
Old 07-11-2012, 06:28 AM   #12
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Git can do a diff (with various output options). The files being compared don't even need to under revision control. Refer to the git-diff manpage for more information.
 
  


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
LXer: Ubuntu Friendly Hardware Certification Program Maturing LXer Syndicated Linux News 0 09-28-2011 06:21 AM
setting git-diff --color-words as git-diff potuz Linux - Software 5 09-09-2010 01:31 PM
where is the diff: in these two program nakulashishsaxena Linux - Newbie 1 08-04-2008 06:01 PM
Dual Boot diff Hard Disk diff OS on Suse 9.1 wilhem Linux - Newbie 1 08-13-2004 06:06 PM
2 diff errors on my Crack5 program Israfel2000 Linux - Software 0 05-30-2004 01:02 PM

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

All times are GMT -5. The time now is 09:53 PM.

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