I wanted to list all functions in 2 files I have, so I used:
cat <file_A> | grep -E "^function"
cat <file_B> | grep -E "^function"
How can I compare the outputs and highlight the similarities?
I wanted to list all functions in 2 files I have, so I used:
cat <file_A> | grep -E "^function"
cat <file_B> | grep -E "^function"
How can I compare the outputs and highlight the similarities?
Two options here:
if you need GUI solution - then you can use Meld Merge tool:
if you need terminal solution - use power of diff:
You can use the process substitution functionality in this way:
You do not need to use
cat
in this case. Also, there is a nice wrapper ofdiff
calledcolordiff
(it must be installed:sudo apt install colordiff
). Here is one of my favorite usages: