I've seen many examples of the use of the diff command, but none detailing its basic use. Here is the content of the two files I would like to use:
cat -A file1.txt
a$
b$
c$
d$
cat -A file2.txt
b$
c$
d$
e$
If I use the diff command like so:
diff file1.txt file2.txt
I get:
1d0
< a
4a4
> e
What I would like to know is what do they mean by lines 1 and 0 in 1d0, and 4 and 4 in 4a4, in addition to the less than and greater than signs. More generally, how come there is a less than sign before the a as opposed to a greater than sign? What's the difference?
Best Answer
From the
diff
manual:The
>
and<
make sense if you look at the side-by-side output format:Example outputs from the manual:
side-by-side:
normal: