I have the below two files inside the same directory:
[admin@localhost Desktop]$ cat abc.txt
cat
dog
zebra
giraff
[admin@localhost Desktop]$ cat def.txt
cat
giraff
tiger
Now my requirement is to comment out the lines which are duplicate inside the files of the directory.
So for instance the word cat and giraff are already there in the file abc.txt so they should be commented out inside the file def.txt.
Can this be done inside a single command in Unix or if not possible a shell script.
I can accomplish the same thing in Python don't know how to do the same in Unix.
Many thanks for any answers.