Grep multiple pattern negative match
You can try:
grep -vE 'Googlebot|msnbot-media|YandexBot|bingbot' yourlogfile
If there is an empty line in the patterns file it will match every line, causing no lines to be returned with -v
. This is because the lines are interpreted as regular expressions, and an empty regular expression will always match.
This isn't a problem with -F
however, because grep
ignores empty lines with -F
.
-F
causes grep
to interpret the lines as simple strings to search for and may speed up grep
if regular expressions aren't needed.