0

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.

Lenton
  • 479
  • 1
  • 3
  • 13
  • 1
    try `grep -a user /var/log/auth.log` it may help you. `-a, --text` Process a binary file as if it were text; this is equivalent to the --binary-files=text option. – P.... May 30 '17 at 11:18

1 Answers1

3

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

Geoffrey
  • 10,843
  • 3
  • 33
  • 46