Only show what's new in a file

Solution 1:

If you want to get the additions only you can filter the output such as:

$ diff test.log.before test.log.after | grep "^>" | cut -c 3-

However, you will lose the deletions if any.

Solution 2:

If you always do a before and after such that the end of the after file will contain the new content then you could use comm.

$ cat before 
aaa
bbb

$ cat after
aaa
bbb
ccc

$ comm -3  after before
ccc