extracting lines bases a list using awk awk 'NR==FNR{a[$1]=$0; next}($1 in a){print a[$1]"\n"$0}' file list 参考 http://521cto.blog.51cto.com/950229/945683 转载于:https://www.cnblogs.com/liuhui0622/p/4488808.html