Re: duplicate entries - compare files



tester wrote:
Hi Gurus,
I need to compare two files which shows me ONLY duplicate entries
(entry common to both files)
i tried "comm" command but it doesn't show me correctly or may be i am
not using it correctly.
Please Help
Regards

You have to sort the files before using commm. Another simple solution
is to use the -d option of uniq (after sorting, of course):

sort file1 file2 | uniq -d

Hubble.

.



Relevant Pages

  • Re: duplicate entries - compare files
    ... I need to compare two files which shows me ONLY duplicate entries ... (entry common to both files) ... i tried "comm" command but it doesn't show me correctly or may be i am ...
    (comp.unix.shell)
  • duplicate entries - compare files
    ... I need to compare two files which shows me ONLY duplicate entries ... (entry common to both files) ... i tried "comm" command but it doesn't show me correctly or may be i am ...
    (comp.unix.shell)
  • Re: compare files
    ... I need to compare two files which shows me ONLY duplicate entries ... (entry common to both files) ... i tried "comm" command but it doesn't show me correctly or may be i am ...
    (comp.lang.awk)
  • Re: comm package issue
    ... I am trying to invoke commands on a remote machine using comm package ... The send command never returns. ...
    (comp.lang.tcl)
  • comm package issue
    ... I am trying to invoke commands on a remote machine using comm package ... The send command never returns. ...
    (comp.lang.tcl)