Please advise why grep -f works faster than grepping multiple keywords indidiuvally on same file.
Some cases, both results are produced in seconds. On certain files, normal grep takes 15 mins and grep -f takes less than a minute.
grep -f <search_pattern_50keys_file.txt> <file_name>
grep search_key_1 <file_name>
grep search_key_1 <file_name>
...
...
grep search_key_50 <file_name>
Regards, Veera