comm - compare two sorted files line by line
$ cat file1.txt
D1
D2
S1
S2
X1
$ cat file2.txt
D1
D2
S1
Z1
$ comm file1.txt file2.txt
To display first column
$ comm -23 file1.txt file2.txt
To display second column
$ comm -13 file1.txt file2.txt
To display third column
$ comm -12 file1.txt file2.txt
regards,
T.Dhanasekar
---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on libera.chat