Skip to content
Advertisement

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

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.

Advertisement

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

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement