SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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]
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?
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.
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!
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.