I have two text files with different outputs. I would like to find the common lines by comparing these two files. This is just an example but I'm finding common values.
file1.txt contains:
12XVGAS4RJQ3wZopCc7bvjRSjHBrRR9bmw
12XVGsHANa9s4Szkmk73nTC5vTJHdFfx7w
12XVGwB6c72mmQCqEwCQtbuKmStw5RqW3X
12XVHEx5yorWhjxzFHMBW1ynPVCNwWfiDR
19vLAtK2PivKYB1ZT1J7dykw3rYga4SoVu
file2.txt contains
1PXT4TSriFBPvwSnC4xZYw33xYq93vKWJA
1PXtc18rtLYEMDpFpXHTeKRjKxor4HMa1m
1PxTPT8Cc2zd2jub8XQ2qU2NUY27Z37J7G
19vLAtK2PivKYB1ZT1J7dykw3rYga4SoVu
Here are the commands I have tried so far to get 19vLAtK2PivKYB1ZT1J7dykw3rYga4SoVu:
- comm -12 <(sort file1.txt) <(sort file2.txt)
- grep -wFf file1.txt file2.txt
I am baffled as to why there is no output but if I try to manually cat and grep both file1.txt and file2.txt I can see the result so this address does exist in both files.
cat file1.txt | grep 19vLAtK2PivKYB1ZT1J7dykw3rYga4SoVu