grep比较两个文本相同不同行

grep -Fxf file1 file2  两个文本中的相同行

grep -Fvxf <(grep -Fxf file1 file2) file1 file2 两个文本中的不同行

   grep -Fvxf same file1 file2 

grep -v -wvf file1 file2 找出file2文件中不同于file1的行

grep -wf file1 file2 找出两个文件中相同的行

原文地址:https://www.cnblogs.com/buptlyn/p/4566890.html