When I compare two files with just numbers, in addition to < and > signs, I also have | signs at some of the lines. For example,

25746 | 26123

I checked the manual and it says


The corresponding lines differ, and they are either both complete or both incomplete.

This statement is not fully clear to me. I checked such lines and couldn't spot a difference than the others. How can I fix these lines to lines with < and >?


  • Relevant part of info diff: Showing Differences Side by Side. I was confused cause I couldn't find it in man diff. – wjandrea Dec 28 '18 at 20:25
  • Could you give an example command and a bit more output? – wjandrea Dec 28 '18 at 20:35
  • Did you read the example in info diff? An Example of Side by Side Format – wjandrea Dec 28 '18 at 20:47
  • Ok, with this example it makes more sense now. However, my goal is to count the different lines, i.e. with < and >. When I try to count the lines with | by using diff file1 file2 | grep "|"|wc -l it returns 0, but I have a lot of similar lines. Is there a way to include/change the lines with | into < and > so that I don't ignore them? – mrq1901 Dec 28 '18 at 23:08
  • I also don't understand why it isn't like this 25746 < (next line) >26123 ? – mrq1901 Dec 28 '18 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.