An easy way to diff log files, ignoring the time stamps?

后端 未结 5 1739
终归单人心
终归单人心 2021-02-01 13:41

I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help m

5条回答
  •  离开以前
    2021-02-01 13:52

    Depending on the shell you are using, you can turn the approach @Blair suggested into a 1-liner

    diff <(cut -b13- file1) <(cut -b13- file2)
    

    (+1 to @Blair for the original suggestion :-)

提交回复
热议问题