Doesn't show the needed info from auth.log file when using grep

1k Views Asked by At

I want to get all info about user from auth.log file, but when I use grep user /var/log/auth.log but instead of giving me all the information with user mentioned, it just writes to me Binary file /var/log/auth.log matches. It used to pick up the sentences with mentioned user, but now it doesn't.

1

There are 1 best solutions below

0
On BEST ANSWER

Sounds like your auth.log has some garbage in it that is making grep believe it is binary, perhaps some UTF-8 encoded data.

Either way, grep has a switch to make it treat it as text anyway

grep -a pattern /var/log/auth.log