I have several columns of gene symbols. I would like to know which gene exists similarly in each of columns

For example, I have three columns which shows that the first gene is similar in the first column and second column,

Is there anyone know how to check for this?

```
ADORA2B     ADORA2B     KLC1
AGPAT5      HOPX        LEPR
ASS1        IGFBP7      LTBP3
C1QBP       INHBA       MBNL2
C4orf19     ITGB5       MLLT11
CASP1       ITGBL1      NOTCH3
CASP1       ITGBL1      NPR3
CASP1                   NUAK1
CASP1                   OLR1
CCL20                   PDGFC
KBTBD11                 PLA2G16
KLF4
ME2
MPDU1
NAT1
PBK
PSMB10
PSMB8
PSMB9
```
    comm -1 -2 <(cut -f1 yourFile | sort) <(cut -f2 yourFile | sort)

Would compare the first and second columns and print only values that were in both columns.

    comm -1 -2 <(cut -f1 yourFile | sort) <(cut -f3 yourFile | sort)

Would compare the first and third columns and print only values that were in both columns.

etc.

As far as I recall, by default sort uses dictionary order, which should work fine for your data. Or maybe the order they're in already matters? If yes, you should probably use awk. For example:

    awk 'FS="\t" {if($1 == $2 && $2 == $3) print}' yourFile

Would only print lines where columns 1 2 and 3 have the same value