perl -F: -ane 'BEGIN {open K, "} print if exists $h{$F[0]}' file1