I have 2 files which contain IP addresses
192.168.1.1:22.214.171.124 192.168.1.2:126.96.36.199 192.168.1.1:188.8.131.52 184.108.40.206:192.168.1.6 192.168.1.4:220.127.116.11
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:18.104.22.168 22.214.171.124:192.168.1.6 192.168.1.4:126.96.36.199