Is there a simple unix command set I can use to separate two lists into three lists that are comprised of the common lines between the two lists, the lines unique to the first, and the lines unique to the last? The lists would be unsorted and each line would be unique.
For example:
List 1:
cat
hat
box
List 2:
box
dog
rock
Output: box, cat hat, dog rock
The output is column based, with column being data only in 1st file, 2nd column being data only in 2nd file, and 3rd column is values common to both.
Note that data is sorted.
If you’re using bash, you can do things like
to temporarly sort the files.
by using args to
commlike-1 -2you can supress the output of column1 and 2, and of course-3by itself would elimate the 3rd column (words in common), leaving just the words not common.I hope this helps.