I’ve used this during our repo process to search through the Netscaler config backup and clean up any server names that are no longer in use.
find a very long list of words in big files:
A.txt - source file
B.txt - list of words to search in A.txt
prep the source file by removing the last \n of A.txt:
$ tr '\n' '|' < A.txt > A.txt_regex
then run egrep:
$ egrep -f A.txt_regex B.txt > Results.txt