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

Teflon Ted picture Teflon Ted · Sep 4, 2008 · Viewed 18.4k times · Source

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 me out?

Answer

toolkit picture toolkit · Sep 4, 2008

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 :-)