title: Identifying the difference in Two files in unix
body: <blockquote>
    <p>I have 2 files rec1.txt and rec2.txt.</p>
  </blockquote>
  
  <pre><code>[gpadmin@subh ~]$cat ret1.txt
  emcas_fin_bi=324
  emcas_fin_drr=3294
  emcas_fin_exp=887
  emcas_fin_optics=0
  emcas_gbo_gs=3077
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[gpadmin@subh ~]$ cat ret2.txt
  emcas_fin_bi=333
  emcas_fin_drr=5528
  emcas_fin_exp=1134
  emcas_fin_optics=0
  emcas_fin_revpro=0
  emcas_gbo_gs=3897
  </code></pre>
  
  <p>I am providing for compare as :-</p>
  
  <pre><code>[gpadmin@subh ~]$ diff -y ret1.txt ret2.txt
  emcas_fin_bi=324                                 | emcas_fin_bi=333
  emcas_fin_drr=3294                               | emcas_fin_drr=5528
  emcas_fin_exp=887                                | emcas_fin_exp=1134
  emcas_fin_optics=0                                 emcas_fin_optics=0
  emcas_gbo_gs=3077                                | emcas_fin_revpro=0
                                                   &gt; emcas_gbo_gs=3897
  </code></pre>
  
  <p>I see this is wrong output from above output since emcas_gbo_gs is common but showing as new word:-</p>
  
  <pre><code>emcas_gbo_gs=3077                                | emcas_fin_revpro=0
                                                   &gt; emcas_gbo_gs=3897
  </code></pre>
  
  <p>Desired Output :-</p>
  
  <pre><code>emcas_gbo_gs=3077                                | emcas_gbo_gs=3897
                                                   &gt; emcas_fin_revpro=0
  </code></pre>