Karmen
Karmen

Reputation: 377

Why does grep -w take a lot longer than grep?

Why does grep -w take so much longer than a simple grep?

Upvotes: 1

Views: 44

Answers (1)

flowit
flowit

Reputation: 1442

grep -w matches whole words, not just 'hits' like the normal grep. This is achieved by applying regular expressions on the input. Regular expressions are by nature a really expensive technique and should always be used with caution.

Upvotes: 2

Related Questions