auth.log regarded as a binary file
I tried to review the auth.log with grep
user@hos:~$ sudo grep 'sshd' /var/log/auth.log
Binary file /var/log/auth.log matches
It prompts auth.log is a binary file, but
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
When come to cat
user@host:~$ sudo cat /var/log/auth.log | grep 'sshd'
Binary file (standard input) matches
Why auth.log is regarded as a binary file?
log
add a comment |
I tried to review the auth.log with grep
user@hos:~$ sudo grep 'sshd' /var/log/auth.log
Binary file /var/log/auth.log matches
It prompts auth.log is a binary file, but
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
When come to cat
user@host:~$ sudo cat /var/log/auth.log | grep 'sshd'
Binary file (standard input) matches
Why auth.log is regarded as a binary file?
log
add a comment |
I tried to review the auth.log with grep
user@hos:~$ sudo grep 'sshd' /var/log/auth.log
Binary file /var/log/auth.log matches
It prompts auth.log is a binary file, but
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
When come to cat
user@host:~$ sudo cat /var/log/auth.log | grep 'sshd'
Binary file (standard input) matches
Why auth.log is regarded as a binary file?
log
I tried to review the auth.log with grep
user@hos:~$ sudo grep 'sshd' /var/log/auth.log
Binary file /var/log/auth.log matches
It prompts auth.log is a binary file, but
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
When come to cat
user@host:~$ sudo cat /var/log/auth.log | grep 'sshd'
Binary file (standard input) matches
Why auth.log is regarded as a binary file?
log
log
asked Jan 24 at 7:23
AliceAlice
450110
450110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
From 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.
So the log file may be corrupted, or some application might have written non-text bytes to the file.
Also see:
- How does -a command line option in grep work?
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112407%2fauth-log-regarded-as-a-binary-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
From 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.
So the log file may be corrupted, or some application might have written non-text bytes to the file.
Also see:
- How does -a command line option in grep work?
add a comment |
From 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.
So the log file may be corrupted, or some application might have written non-text bytes to the file.
Also see:
- How does -a command line option in grep work?
add a comment |
From 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.
So the log file may be corrupted, or some application might have written non-text bytes to the file.
Also see:
- How does -a command line option in grep work?
From 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.
So the log file may be corrupted, or some application might have written non-text bytes to the file.
Also see:
- How does -a command line option in grep work?
answered Jan 24 at 7:33
OlorinOlorin
2,657924
2,657924
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112407%2fauth-log-regarded-as-a-binary-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown