linux使用diff命令对比两个文件的内容 diff file1.txt file2.txt > result.txt 对比结果保存在result.txt diff使用 -n 选项对比两个文件并输出行号的示例 diff -n file1.txt file2.txt > result.txt