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