Quote:
Originally Posted by dthims
cat /var/log/mail.log |grep 'connect from unknown[192.168.1.10]'
|
That is looking for the string "connect from unknown" immediately (with no intervening space) followed by one of the characters from the set "012689." . The square brackets and "." are all special to
grep. You need to either escape them with a backslash or use the "-F" (--fixed-strings) option in
grep.
Code:
cat /var/log/mail.log |grep 'connect from unknown \[192\.168\.1\.10\]'
# or
cat /var/log/mail.log | grep -F 'connect from unknown [192.168.1.10]'