jeudi 27 octobre 2016

How many times grep loops over file1 when patterns are provided in a separate file2 ( -f option )

When using grep with the -f option, does the grep get executed as many times as there are patterns in the -f pattern.txt ? Is

grep -f pattern.txt myfile.txt

faster than

grep -e "one" -e "two" -e "three" myfile.txt

if pattern.txt contains

one
two
three

?

Aucun commentaire:

Enregistrer un commentaire