auth.log regarded as a binary file












0















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?










share|improve this question



























    0















    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?










    share|improve this question

























      0












      0








      0








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 24 at 7:23









      AliceAlice

      450110




      450110






















          1 Answer
          1






          active

          oldest

          votes


















          2














          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?






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            2














            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?






            share|improve this answer




























              2














              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?






              share|improve this answer


























                2












                2








                2







                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?






                share|improve this answer













                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?







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 24 at 7:33









                OlorinOlorin

                2,657924




                2,657924






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?