Is there a condensed side-by-side diff format?












38















I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines.



Unified diffs allow me to see the detailed differences, but it makes manual comparison with eyeballs hard. Side-by-side diffs seems more useful for comparison, but it also adds thousands of unchanged lines. Is there a way to get the advantage of both worlds?



Note, these log files are generated by xscope which is a program that monitors Xorg protocol data. I am looking for general-purpose tools that can be applied to situations similar to the above, not specialized webserver access log analysis tools for example.





Two example log files are available at http://lekensteyn.nl/files/qemu-sdl-debug/ (log13 and log14). A pre-processor command can be found in the xscope-filter file which removes timestamps and other minor details.










share|improve this question




















  • 1





    Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

    – manatwork
    Jun 12 '13 at 10:46








  • 1





    @manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

    – Lekensteyn
    Jun 12 '13 at 10:50






  • 5





    Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

    – manatwork
    Jun 12 '13 at 11:07













  • I think you should put vimdiff up as an answer :)

    – Kotte
    Jun 12 '13 at 14:03






  • 1





    CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

    – Lekensteyn
    Jun 12 '13 at 15:30
















38















I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines.



Unified diffs allow me to see the detailed differences, but it makes manual comparison with eyeballs hard. Side-by-side diffs seems more useful for comparison, but it also adds thousands of unchanged lines. Is there a way to get the advantage of both worlds?



Note, these log files are generated by xscope which is a program that monitors Xorg protocol data. I am looking for general-purpose tools that can be applied to situations similar to the above, not specialized webserver access log analysis tools for example.





Two example log files are available at http://lekensteyn.nl/files/qemu-sdl-debug/ (log13 and log14). A pre-processor command can be found in the xscope-filter file which removes timestamps and other minor details.










share|improve this question




















  • 1





    Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

    – manatwork
    Jun 12 '13 at 10:46








  • 1





    @manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

    – Lekensteyn
    Jun 12 '13 at 10:50






  • 5





    Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

    – manatwork
    Jun 12 '13 at 11:07













  • I think you should put vimdiff up as an answer :)

    – Kotte
    Jun 12 '13 at 14:03






  • 1





    CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

    – Lekensteyn
    Jun 12 '13 at 15:30














38












38








38


18






I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines.



Unified diffs allow me to see the detailed differences, but it makes manual comparison with eyeballs hard. Side-by-side diffs seems more useful for comparison, but it also adds thousands of unchanged lines. Is there a way to get the advantage of both worlds?



Note, these log files are generated by xscope which is a program that monitors Xorg protocol data. I am looking for general-purpose tools that can be applied to situations similar to the above, not specialized webserver access log analysis tools for example.





Two example log files are available at http://lekensteyn.nl/files/qemu-sdl-debug/ (log13 and log14). A pre-processor command can be found in the xscope-filter file which removes timestamps and other minor details.










share|improve this question
















I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines.



Unified diffs allow me to see the detailed differences, but it makes manual comparison with eyeballs hard. Side-by-side diffs seems more useful for comparison, but it also adds thousands of unchanged lines. Is there a way to get the advantage of both worlds?



Note, these log files are generated by xscope which is a program that monitors Xorg protocol data. I am looking for general-purpose tools that can be applied to situations similar to the above, not specialized webserver access log analysis tools for example.





Two example log files are available at http://lekensteyn.nl/files/qemu-sdl-debug/ (log13 and log14). A pre-processor command can be found in the xscope-filter file which removes timestamps and other minor details.







diff






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 17 '16 at 20:21









Randall

24919




24919










asked Jun 12 '13 at 10:40









LekensteynLekensteyn

9,963115288




9,963115288








  • 1





    Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

    – manatwork
    Jun 12 '13 at 10:46








  • 1





    @manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

    – Lekensteyn
    Jun 12 '13 at 10:50






  • 5





    Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

    – manatwork
    Jun 12 '13 at 11:07













  • I think you should put vimdiff up as an answer :)

    – Kotte
    Jun 12 '13 at 14:03






  • 1





    CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

    – Lekensteyn
    Jun 12 '13 at 15:30














  • 1





    Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

    – manatwork
    Jun 12 '13 at 10:46








  • 1





    @manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

    – Lekensteyn
    Jun 12 '13 at 10:50






  • 5





    Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

    – manatwork
    Jun 12 '13 at 11:07













  • I think you should put vimdiff up as an answer :)

    – Kotte
    Jun 12 '13 at 14:03






  • 1





    CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

    – Lekensteyn
    Jun 12 '13 at 15:30








1




1





Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

– manatwork
Jun 12 '13 at 10:46







Does your diff have --suppress-common-lines option? pastebin.com/KZrVCNFR

– manatwork
Jun 12 '13 at 10:46






1




1





@manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

– Lekensteyn
Jun 12 '13 at 10:50





@manatwork Nice, it does. Any way to add more context (e.g. line numbers)?

– Lekensteyn
Jun 12 '13 at 10:50




5




5





Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

– manatwork
Jun 12 '13 at 11:07







Then maybe vimdiff (from the vim package) would serve your needs better: parallel display, colorized, common lines folded. Line numbers can be turned on with :set number.

– manatwork
Jun 12 '13 at 11:07















I think you should put vimdiff up as an answer :)

– Kotte
Jun 12 '13 at 14:03





I think you should put vimdiff up as an answer :)

– Kotte
Jun 12 '13 at 14:03




1




1





CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

– Lekensteyn
Jun 12 '13 at 15:30





CLI tools are preferred, but GUI tools are also allowed if they are tiny enough. I have tried kdiff3, but it still produced to much detail. Ideally, I don't see all unnecessary detail. I'll attach two data sets.

– Lekensteyn
Jun 12 '13 at 15:30










4 Answers
4






active

oldest

votes


















33














The 2 diff tools I use the most would be meld and sdiff.



meld



Meld is a GUI but does a great job in showing diffs between files. It's geared more for software development with features such as the ability to move changes from one side to the other to merge changes but can be used as just a straight side-by-side diffing tool.



    ss of meld



    ss of meld code highlighting



sdiff



I've used this tool for years. I generally run it with the following switches:



$ sdiff -bBWs file1 file2




  • -b Ignore changes in the amount of white space.


  • -W Ignore all white space.


  • -B Ignore changes whose lines are all blank.


  • -s Do not output common lines.


Often with log files you'll need to make the width of the columns wider, you can use -w <num> to make the screen wider.



other tools that I use off and on



diffc



Diffc is a python script which colorizes unified diff output.



$ diffc [OPTION] FILE1 FILE2


             ss of diffc



vimdiff



Vimdiff is probably as good if not better than meld and it can be run from a terminal. I always forget to use it though which, to me, is a good indicator that I find the tool just a little to tough to use day to day. But YMMV.



                                    ss of vimdiff






share|improve this answer





















  • 1





    One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

    – manatwork
    Jun 12 '13 at 14:35











  • Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

    – slm
    Jun 12 '13 at 14:42











  • @manatwork - added your link to the answer, thanks for the feedback!

    – slm
    Jun 12 '13 at 14:51






  • 1





    Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

    – Lekensteyn
    Jun 12 '13 at 15:45











  • I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

    – slm
    Jun 12 '13 at 16:15



















18














Currently I am using side-by-side diff with grep filtering the different lines:



diff -y -W250 log.txt log2.txt | expand | 
grep -E -C3 '^.{123} [|<>]( |$)' | colordiff | less -rS



  • Option -W250 makes the output wider such that I can see more data.


  • expand is necessary to convert tabs to spaces


  • -C3 adds 3 lines of context to the grep output.


  • ^.{123} matches half of the data before the side-by-side diff markers.


  • colordiff makes the output prettier to follow


  • less -rS allows ANSI colors to be interpreted (-r) and prevents wrapped lines (-S).


This is a hack, alternatives are welcome.






share|improve this answer



















  • 1





    This is wonderful.

    – Pat Myron
    Mar 17 '17 at 3:52











  • Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

    – Timmmm
    Jul 27 '18 at 13:48



















11














Nobody mentioned icdiff yet? It's great! Pic speaks for itself:
icdiff






share|improve this answer
























  • This is a very neat tool, also available on aur.

    – Uzumaki D. Ichigo
    Feb 16 '18 at 10:09











  • Too slow for large files though.

    – Timmmm
    Jul 27 '18 at 13:30



















0














The linux "sdiff" command shows side-by-side differences, by default including all lines, but you can use various options to show only differences:



sdiff -tWBs -w $COLUMNS config.xml config.xml.original



where



-t: translate tabs to spaces



-W: ignore whitespace differences



-B: ignore blank lines



-s: ignore lines that are the same



-w $COLUMNS: use full width of screen



The lines shown will be divided by |, <, or > -- see documentation, or just try it.






share|improve this answer








New contributor




Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f79135%2fis-there-a-condensed-side-by-side-diff-format%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    33














    The 2 diff tools I use the most would be meld and sdiff.



    meld



    Meld is a GUI but does a great job in showing diffs between files. It's geared more for software development with features such as the ability to move changes from one side to the other to merge changes but can be used as just a straight side-by-side diffing tool.



        ss of meld



        ss of meld code highlighting



    sdiff



    I've used this tool for years. I generally run it with the following switches:



    $ sdiff -bBWs file1 file2




    • -b Ignore changes in the amount of white space.


    • -W Ignore all white space.


    • -B Ignore changes whose lines are all blank.


    • -s Do not output common lines.


    Often with log files you'll need to make the width of the columns wider, you can use -w <num> to make the screen wider.



    other tools that I use off and on



    diffc



    Diffc is a python script which colorizes unified diff output.



    $ diffc [OPTION] FILE1 FILE2


                 ss of diffc



    vimdiff



    Vimdiff is probably as good if not better than meld and it can be run from a terminal. I always forget to use it though which, to me, is a good indicator that I find the tool just a little to tough to use day to day. But YMMV.



                                        ss of vimdiff






    share|improve this answer





















    • 1





      One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

      – manatwork
      Jun 12 '13 at 14:35











    • Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

      – slm
      Jun 12 '13 at 14:42











    • @manatwork - added your link to the answer, thanks for the feedback!

      – slm
      Jun 12 '13 at 14:51






    • 1





      Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

      – Lekensteyn
      Jun 12 '13 at 15:45











    • I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

      – slm
      Jun 12 '13 at 16:15
















    33














    The 2 diff tools I use the most would be meld and sdiff.



    meld



    Meld is a GUI but does a great job in showing diffs between files. It's geared more for software development with features such as the ability to move changes from one side to the other to merge changes but can be used as just a straight side-by-side diffing tool.



        ss of meld



        ss of meld code highlighting



    sdiff



    I've used this tool for years. I generally run it with the following switches:



    $ sdiff -bBWs file1 file2




    • -b Ignore changes in the amount of white space.


    • -W Ignore all white space.


    • -B Ignore changes whose lines are all blank.


    • -s Do not output common lines.


    Often with log files you'll need to make the width of the columns wider, you can use -w <num> to make the screen wider.



    other tools that I use off and on



    diffc



    Diffc is a python script which colorizes unified diff output.



    $ diffc [OPTION] FILE1 FILE2


                 ss of diffc



    vimdiff



    Vimdiff is probably as good if not better than meld and it can be run from a terminal. I always forget to use it though which, to me, is a good indicator that I find the tool just a little to tough to use day to day. But YMMV.



                                        ss of vimdiff






    share|improve this answer





















    • 1





      One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

      – manatwork
      Jun 12 '13 at 14:35











    • Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

      – slm
      Jun 12 '13 at 14:42











    • @manatwork - added your link to the answer, thanks for the feedback!

      – slm
      Jun 12 '13 at 14:51






    • 1





      Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

      – Lekensteyn
      Jun 12 '13 at 15:45











    • I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

      – slm
      Jun 12 '13 at 16:15














    33












    33








    33







    The 2 diff tools I use the most would be meld and sdiff.



    meld



    Meld is a GUI but does a great job in showing diffs between files. It's geared more for software development with features such as the ability to move changes from one side to the other to merge changes but can be used as just a straight side-by-side diffing tool.



        ss of meld



        ss of meld code highlighting



    sdiff



    I've used this tool for years. I generally run it with the following switches:



    $ sdiff -bBWs file1 file2




    • -b Ignore changes in the amount of white space.


    • -W Ignore all white space.


    • -B Ignore changes whose lines are all blank.


    • -s Do not output common lines.


    Often with log files you'll need to make the width of the columns wider, you can use -w <num> to make the screen wider.



    other tools that I use off and on



    diffc



    Diffc is a python script which colorizes unified diff output.



    $ diffc [OPTION] FILE1 FILE2


                 ss of diffc



    vimdiff



    Vimdiff is probably as good if not better than meld and it can be run from a terminal. I always forget to use it though which, to me, is a good indicator that I find the tool just a little to tough to use day to day. But YMMV.



                                        ss of vimdiff






    share|improve this answer















    The 2 diff tools I use the most would be meld and sdiff.



    meld



    Meld is a GUI but does a great job in showing diffs between files. It's geared more for software development with features such as the ability to move changes from one side to the other to merge changes but can be used as just a straight side-by-side diffing tool.



        ss of meld



        ss of meld code highlighting



    sdiff



    I've used this tool for years. I generally run it with the following switches:



    $ sdiff -bBWs file1 file2




    • -b Ignore changes in the amount of white space.


    • -W Ignore all white space.


    • -B Ignore changes whose lines are all blank.


    • -s Do not output common lines.


    Often with log files you'll need to make the width of the columns wider, you can use -w <num> to make the screen wider.



    other tools that I use off and on



    diffc



    Diffc is a python script which colorizes unified diff output.



    $ diffc [OPTION] FILE1 FILE2


                 ss of diffc



    vimdiff



    Vimdiff is probably as good if not better than meld and it can be run from a terminal. I always forget to use it though which, to me, is a good indicator that I find the tool just a little to tough to use day to day. But YMMV.



                                        ss of vimdiff







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jun 12 '13 at 14:51

























    answered Jun 12 '13 at 14:27









    slmslm

    251k69529685




    251k69529685








    • 1





      One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

      – manatwork
      Jun 12 '13 at 14:35











    • Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

      – slm
      Jun 12 '13 at 14:42











    • @manatwork - added your link to the answer, thanks for the feedback!

      – slm
      Jun 12 '13 at 14:51






    • 1





      Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

      – Lekensteyn
      Jun 12 '13 at 15:45











    • I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

      – slm
      Jun 12 '13 at 16:15














    • 1





      One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

      – manatwork
      Jun 12 '13 at 14:35











    • Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

      – slm
      Jun 12 '13 at 14:42











    • @manatwork - added your link to the answer, thanks for the feedback!

      – slm
      Jun 12 '13 at 14:51






    • 1





      Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

      – Lekensteyn
      Jun 12 '13 at 15:45











    • I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

      – slm
      Jun 12 '13 at 16:15








    1




    1





    One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

    – manatwork
    Jun 12 '13 at 14:35





    One great feature of Meld, unfortunately not visible on your screenshot, is syntax highlighting of source code files.

    – manatwork
    Jun 12 '13 at 14:35













    Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

    – slm
    Jun 12 '13 at 14:42





    Yes. I used to use vimdiff all the time, I've since moved to using meld, I find it easier to use and it's just easier to see what it's telling me vs. vimdiff.

    – slm
    Jun 12 '13 at 14:42













    @manatwork - added your link to the answer, thanks for the feedback!

    – slm
    Jun 12 '13 at 14:51





    @manatwork - added your link to the answer, thanks for the feedback!

    – slm
    Jun 12 '13 at 14:51




    1




    1





    Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

    – Lekensteyn
    Jun 12 '13 at 15:45





    Looks great for source code, but not so much for comparing log files. I often use colordiff from colordiff.org for source file. To my understanding, sdiff is similar to diff -y with no differences in output but slightly different options. +1 for showing some good alternatives to plain diff.

    – Lekensteyn
    Jun 12 '13 at 15:45













    I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

    – slm
    Jun 12 '13 at 16:15





    I've not ever used colordiff, I'll have to check it out. You're correct on the diff -y. The addition of that switch to diff seems to have happened at some point, or I never noticed it. Additionally here's a link to the gnu diff tools resource page. Good stuff for using this suite of tools.

    – slm
    Jun 12 '13 at 16:15













    18














    Currently I am using side-by-side diff with grep filtering the different lines:



    diff -y -W250 log.txt log2.txt | expand | 
    grep -E -C3 '^.{123} [|<>]( |$)' | colordiff | less -rS



    • Option -W250 makes the output wider such that I can see more data.


    • expand is necessary to convert tabs to spaces


    • -C3 adds 3 lines of context to the grep output.


    • ^.{123} matches half of the data before the side-by-side diff markers.


    • colordiff makes the output prettier to follow


    • less -rS allows ANSI colors to be interpreted (-r) and prevents wrapped lines (-S).


    This is a hack, alternatives are welcome.






    share|improve this answer



















    • 1





      This is wonderful.

      – Pat Myron
      Mar 17 '17 at 3:52











    • Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

      – Timmmm
      Jul 27 '18 at 13:48
















    18














    Currently I am using side-by-side diff with grep filtering the different lines:



    diff -y -W250 log.txt log2.txt | expand | 
    grep -E -C3 '^.{123} [|<>]( |$)' | colordiff | less -rS



    • Option -W250 makes the output wider such that I can see more data.


    • expand is necessary to convert tabs to spaces


    • -C3 adds 3 lines of context to the grep output.


    • ^.{123} matches half of the data before the side-by-side diff markers.


    • colordiff makes the output prettier to follow


    • less -rS allows ANSI colors to be interpreted (-r) and prevents wrapped lines (-S).


    This is a hack, alternatives are welcome.






    share|improve this answer



















    • 1





      This is wonderful.

      – Pat Myron
      Mar 17 '17 at 3:52











    • Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

      – Timmmm
      Jul 27 '18 at 13:48














    18












    18








    18







    Currently I am using side-by-side diff with grep filtering the different lines:



    diff -y -W250 log.txt log2.txt | expand | 
    grep -E -C3 '^.{123} [|<>]( |$)' | colordiff | less -rS



    • Option -W250 makes the output wider such that I can see more data.


    • expand is necessary to convert tabs to spaces


    • -C3 adds 3 lines of context to the grep output.


    • ^.{123} matches half of the data before the side-by-side diff markers.


    • colordiff makes the output prettier to follow


    • less -rS allows ANSI colors to be interpreted (-r) and prevents wrapped lines (-S).


    This is a hack, alternatives are welcome.






    share|improve this answer













    Currently I am using side-by-side diff with grep filtering the different lines:



    diff -y -W250 log.txt log2.txt | expand | 
    grep -E -C3 '^.{123} [|<>]( |$)' | colordiff | less -rS



    • Option -W250 makes the output wider such that I can see more data.


    • expand is necessary to convert tabs to spaces


    • -C3 adds 3 lines of context to the grep output.


    • ^.{123} matches half of the data before the side-by-side diff markers.


    • colordiff makes the output prettier to follow


    • less -rS allows ANSI colors to be interpreted (-r) and prevents wrapped lines (-S).


    This is a hack, alternatives are welcome.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 12 '13 at 10:55









    LekensteynLekensteyn

    9,963115288




    9,963115288








    • 1





      This is wonderful.

      – Pat Myron
      Mar 17 '17 at 3:52











    • Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

      – Timmmm
      Jul 27 '18 at 13:48














    • 1





      This is wonderful.

      – Pat Myron
      Mar 17 '17 at 3:52











    • Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

      – Timmmm
      Jul 27 '18 at 13:48








    1




    1





    This is wonderful.

    – Pat Myron
    Mar 17 '17 at 3:52





    This is wonderful.

    – Pat Myron
    Mar 17 '17 at 3:52













    Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

    – Timmmm
    Jul 27 '18 at 13:48





    Nice idea. Unfortunately the grep regex is too slow. Also diff has a -t option to expand tabs.

    – Timmmm
    Jul 27 '18 at 13:48











    11














    Nobody mentioned icdiff yet? It's great! Pic speaks for itself:
    icdiff






    share|improve this answer
























    • This is a very neat tool, also available on aur.

      – Uzumaki D. Ichigo
      Feb 16 '18 at 10:09











    • Too slow for large files though.

      – Timmmm
      Jul 27 '18 at 13:30
















    11














    Nobody mentioned icdiff yet? It's great! Pic speaks for itself:
    icdiff






    share|improve this answer
























    • This is a very neat tool, also available on aur.

      – Uzumaki D. Ichigo
      Feb 16 '18 at 10:09











    • Too slow for large files though.

      – Timmmm
      Jul 27 '18 at 13:30














    11












    11








    11







    Nobody mentioned icdiff yet? It's great! Pic speaks for itself:
    icdiff






    share|improve this answer













    Nobody mentioned icdiff yet? It's great! Pic speaks for itself:
    icdiff







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 24 '17 at 10:07









    Radek PostołowiczRadek Postołowicz

    21125




    21125













    • This is a very neat tool, also available on aur.

      – Uzumaki D. Ichigo
      Feb 16 '18 at 10:09











    • Too slow for large files though.

      – Timmmm
      Jul 27 '18 at 13:30



















    • This is a very neat tool, also available on aur.

      – Uzumaki D. Ichigo
      Feb 16 '18 at 10:09











    • Too slow for large files though.

      – Timmmm
      Jul 27 '18 at 13:30

















    This is a very neat tool, also available on aur.

    – Uzumaki D. Ichigo
    Feb 16 '18 at 10:09





    This is a very neat tool, also available on aur.

    – Uzumaki D. Ichigo
    Feb 16 '18 at 10:09













    Too slow for large files though.

    – Timmmm
    Jul 27 '18 at 13:30





    Too slow for large files though.

    – Timmmm
    Jul 27 '18 at 13:30











    0














    The linux "sdiff" command shows side-by-side differences, by default including all lines, but you can use various options to show only differences:



    sdiff -tWBs -w $COLUMNS config.xml config.xml.original



    where



    -t: translate tabs to spaces



    -W: ignore whitespace differences



    -B: ignore blank lines



    -s: ignore lines that are the same



    -w $COLUMNS: use full width of screen



    The lines shown will be divided by |, <, or > -- see documentation, or just try it.






    share|improve this answer








    New contributor




    Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      The linux "sdiff" command shows side-by-side differences, by default including all lines, but you can use various options to show only differences:



      sdiff -tWBs -w $COLUMNS config.xml config.xml.original



      where



      -t: translate tabs to spaces



      -W: ignore whitespace differences



      -B: ignore blank lines



      -s: ignore lines that are the same



      -w $COLUMNS: use full width of screen



      The lines shown will be divided by |, <, or > -- see documentation, or just try it.






      share|improve this answer








      New contributor




      Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        The linux "sdiff" command shows side-by-side differences, by default including all lines, but you can use various options to show only differences:



        sdiff -tWBs -w $COLUMNS config.xml config.xml.original



        where



        -t: translate tabs to spaces



        -W: ignore whitespace differences



        -B: ignore blank lines



        -s: ignore lines that are the same



        -w $COLUMNS: use full width of screen



        The lines shown will be divided by |, <, or > -- see documentation, or just try it.






        share|improve this answer








        New contributor




        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        The linux "sdiff" command shows side-by-side differences, by default including all lines, but you can use various options to show only differences:



        sdiff -tWBs -w $COLUMNS config.xml config.xml.original



        where



        -t: translate tabs to spaces



        -W: ignore whitespace differences



        -B: ignore blank lines



        -s: ignore lines that are the same



        -w $COLUMNS: use full width of screen



        The lines shown will be divided by |, <, or > -- see documentation, or just try it.







        share|improve this answer








        New contributor




        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 40 mins ago









        Moshe YudkowskyMoshe Yudkowsky

        1




        1




        New contributor




        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Moshe Yudkowsky is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f79135%2fis-there-a-condensed-side-by-side-diff-format%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Loup dans la culture

            How to solve the problem of ntp “Unable to contact time server” from KDE?

            ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux