Я пытался рассмотреть auth.log с grep
user@hos:~$ sudo grep 'sshd' /var/log/auth.log
Binary file /var/log/auth.log matches
Это запрашивает auth.log, двоичный файл, но
user@host~$ sudo tail -n 3 /var/log/auth.log
Jan 24 15:19:53 assistant sudo: pam_unix(sudo:session): session opened for user root by assistant(uid=0)
Jan 24 15:19:53 assistant sudo: pam_unix(sudo:session): session closed for user root
Jan 24 15:20:04 assistant sudo: assistant : TTY=pts/0 ; PWD=/home/assistant ; USER=root ; COMMAND=/usr/bin/tail -n 3 /var/log/auth.log
При прибытии в кошку
user@host:~$ sudo cat /var/log/auth.log | grep 'sshd'
Binary file (standard input) matches
Почему auth.log рассматривается как двоичный файл?
От man grep
:
--binary-files=TYPE
If a file's data or metadata indicate that the file contains binary data, assume
that the file is of type TYPE. Non-text bytes indicate binary data; these are
either output bytes that are improperly encoded for the current locale, or null
input bytes when the -z option is not given.
Таким образом, файл журнала может быть поврежден, или некоторое приложение, возможно, записало нетекстовые байты в файл.
Также см.: