I have 2 files which contain IP addresses
192.168.1.1:220.127.116.11 192.168.1.2:18.104.22.168 192.168.1.1:22.214.171.124 126.96.36.199:192.168.1.6 192.168.1.4:188.8.131.52
Now I want a script which takes each value from file 2nd and checks and if that values is present in files 1st. If the value is present it should print the entire line from file 1st.
For example desired result from above example:
192.168.1.2:184.108.40.206 220.127.116.11:192.168.1.6 192.168.1.4:18.104.22.168