I have a list from an inventory and another list from management. I'm trying to find the IP's that are similar between both files then output that is similar into another file:I tried using diff but, the output did not made sense.diff -buy list1 list2then I tried to use  egrep using IP's from list 1but, I think I used the wrong syntax.egrep -o `192.168.*|192.1.69` list2not sure what to use correctlylike:list 1 maybe have:192.168.1.1192.168.1.2192.168.1.3192.168.2.1and I want to try to find this IPs in list2
Compare different IPs in two files?
text processing;grep;scripting;file comparison
Solution in bash or a similar shell with process substitution using the <(...) form:comm -1 -2 <(sort list1) <(sort list2)Should you have duplicate entries in list2 then add the -u option to the sort call.