Up front I should say that I had a nice post about diff
and cmp
and the other tools in diffutils ready, but by some freakish twist of fate, it seems to have vanished.
I blame no one for that, but it does mean that this post is a very abbreviated version — a mere shadow of its former glory.
In short, diff
shows what’s different between two files, line by line. It sounds simpler than it is.
As you can see, line by line, diff
shows changes into or out of a file, as it compares to another.
If you’ve worked with diff
, it was probably under the pretext of patches for code; that’s where I learned what little I know about it.
Technically diff
only works with two files; diff3
should help you sift through three at a time.
At this point, you’re probably thinking that diff
alone is only marginally useful, and obviously intended toward patching things. After all, it’s hardly readable except by experienced users.
To that end, I offer you sdiff
, making life easy since … since … well, anyway:
As you can see, sdiff
does you the favor of flagging differing lines with pipe symbols. Much easier to absorb, for visual people … like me.
One last note: cmp
comes with diff
, but is quite different.
Where diff
is comparing lines of text, cmp
is working byte-by-byte. I can only suggest that this might be useful if you’re looking for one or two different characters in two similar files — perhaps a data corruption issue, or something like it. I don’t have quite so much experience with cmp
, as I do with diff
… which isn’t saying much. š
In closing I should mention that each of these has a laundry list of files and options, and a lot more ways to be put to use than what I show here.
But I think I hit the main points of the old post. I’ll dig around some more and see if I can dredge it up, but I have the feeling it’s lost to the ether. Such is life. š
Pingback: Bonus: And so D goes | Inconsolation
Pingback: mcdiff, mcedit mcview: Internal tools, externalized | Inconsolation
It’s on the list. Please try to be patient for about … six months or so. š
Pingback: patch: Piecing together what I should say | Inconsolation
Pingback: colordiff: A difference in color | Inconsolation
Pingback: wdiff, cwdiff and dwdiff: Since I mentioned it. … | Inconsolation
Pingback: cloc: Clock your code | Inconsolation
Pingback: grc: More colorizing for terminal output | Inconsolation
Pingback: Bonus: A dozen more remainders | Inconsolation
Pingback: Bonus: A dozen more remainders | Linux Admins
Pingback: dhex: A hex editor with a diff … erence | Inconsolation
Pingback: dhex: A hex editor with a diff ⦠erence | Linux Admins
Pingback: icdiff: Visibility by default | Inconsolation
Pingback: icdiff: Visibility by default | Linux Admins