Personalize Diff Command in Ubuntu
- by acidboy
I have two files, both with a lot of data, what I need is compare the first word of each file (each file always starts with a number, and each number could have many digits).
The files are identical when these numbers are the same.
Example:
I have 3 files: a.txt, b.txt and 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"
How can I compare them using the diff command?