awk 'NR==FNR{huty[$1]=$2;next}NR>FNR{if($1 in huty){print $0 " " huty[$1]} else {print $0 " " "None"}}' input1.txt input2.txt > output.txt cat output.txt 北京 beijing 上海 shanghai 广州 guangzhou 南京 None