Small mistakes like that can certainly trip you up!
Incidentally, this is wrong, even if you're using the right date format:
egrep -i "*18/Dec/12*" /var/log/httpd/access.log
uses regular expressions
, not globbing
(wildcard) patterns. While in globbing '*
' has the meaning of "an unbroken string of characters of any type and length, including none", in regex it means "zero or more instances of the previous
character". So on its own it's almost meaningless, and may even match something you don't want.
To get the wildcard behavior in regex you have to use ".*
", with ".
" meaning "any character
It's well worth taking the time to familiarize yourself with regex. Here are a few links for you:
And this link will give you a general overview of globbing (although it's actually written for the bash
shell flavor of it and not everything mentioned is supported by other tools).