How to display line numbers in side by side diff in unix?
sdiff -s <(cat -n file1.txt) <(cat -n file2.txt)
This gives you side-by-side output with line-numbers from the source files.
Below code can be used to display the uncommon fields in two files, side by side.
sdiff -l file1 file2 | cat -n | grep -v -e '($'
Below code will display common fields along with line numbers in the output.
diff -y file1 file2 | cat -n | grep -v -e '($'