You can use the diff command to compare the contents of two files and highlight the differences between them.
To demonstrate, let’s first make a copy of the file facts.txt named facts2.txt:
elliot@ubuntu-linux:~$ cp facts.txt facts2.txt
Now let’s append the line "Brazil is a country." to the file facts2.txt:
elliot@ubuntu-linux:~$ echo "Brazil is a country." >> facts2.txt
Now, run the diff command on both files:
elliot@ubuntu-linux:~$ diff facts.txt facts2.txt
12a13
> Brazil is a country.
Cool! It outputs the difference between the two files, which in this case, is the line Brazil is a country.