我有两个文件,都有很多数据,我需要比较每个文件的第一个单词(每个文件总是以一个数字开头,每个数字可以有很多位)。
当这些数字相同时,文件是相同的。
示例:我有 3 个文件:a.txt、b.txt 和 c.txt
a.txt content is "1 a b c 3 5 6 hjkj"
b.txt content is "1 c f a 1234 h"
c.txt content is "2 a b c 3 5 6 hjkj"
diff a.txt b.txt should return "files are identical"
diff a.txt c.txt should return "files are different"
如何使用 diff 命令比较它们?