I need help with awk.  I have two tab-separated files:File 1123   456135   567234   478File 2123    notimportant    notimportant2456    notimportant    notimportant2987    notimportant    notimportant2135    notimportant    notimportant2234    notimportant    notimportant2478    notimportant    notimportant2I need to extract lines from file1 if both entries in a single row are present in file2's first column. So the output file should be like:Output123   456234   478I previously used this awk command to extract rows if only the first column of file1 matched 1st column of file2awk 'FNR==NR{a[$1];next}($1 in a){print}' file2 file1But I don't know how to expand it. Any advice would be appreciated!
Extract row if both column values appear in a single column from a separate file
text processing;awk
awk 'FNR==NR{a[$1]++;next;}($1 in a)&&($2 in a){print}' file2 file1perl -lane '   @ARGV and $h{$F[0]}++,next;   print if @F == grep { $h{$_} } @F;' file2 file1