I am new dummy user of Unix, so excuse me for maybe easy question.I have multiple files which look like this:balternate_ids rsid chromosome position alleleA alleleB index average_maximum_posterior_call info cohort_1_AA cohort_1_AB cohort_1_BB cohort_1_NULL all_AA all_AB all_BB all_NULL all_total all_maf missing_data_proportion frequentist_add_pvalue frequentist_add_info frequentist_add_beta_1 frequentist_add_se_1 comment--- rs148087467 NA 60523 T G 1 0.999401 0.266624 7261.6 5.39417 0.00299072 0 7261.6 5.39417 0.00299072 0 7267 0.000371553 0 0.584342 0.247422 -0.473097 0.86481 NA--- rs187110906 NA 60969 C A 2 0.995453 0.23508 7228.62 38.2204 0.138092 0.0169067 7228.62 38.2204 0.138092 0.0169067 7267 0.00264873 1.16325e-06 0.803757 0.281439 0.0754077 0which I need to match with another file:ars586178rs79598313rs72634501rs191448950rs9988450rs11207995In case alternate_ids and a matches, print matched row to a new file.I have heard about $ awk -F'|' 'NR==FNR{c[$1$2]++;next};c[$1$2] > 0' file2 file1but it compares only 2 files. Should I make a loop to run through all of files? Thanks for any suggestions.
Compare multiple files with ref file and print if it matches
shell script;text processing
This should parse the file a and if one of the lines is in file b , it will display the line :  for i in $(<a); do grep $i b; doneIf you have one file of type a which contains the keys, and several of type b, you can just replace b with a variable looping on the filenames.