sysctl command returning info not asked about

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to grep a particular kernel setting as follows



$ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null
sysctl: reading key "net.ipv6.conf.all.stable_secret"
sysctl: reading key "net.ipv6.conf.default.stable_secret"
sysctl: reading key "net.ipv6.conf.docker0.stable_secret"
sysctl: reading key "net.ipv6.conf.enp2s0.stable_secret"
sysctl: reading key "net.ipv6.conf.lo.stable_secret"
sysctl: reading key "net.ipv6.conf.wlp3s0.stable_secret"
vm.max_map_count = 262144


Since I am both ignoring info about unknown keys (i.e. the --ignore option) and redirecting potential error output to /dev/null, what are these reading jey lines printed?










share|improve this question

























    up vote
    1
    down vote

    favorite












    I want to grep a particular kernel setting as follows



    $ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null
    sysctl: reading key "net.ipv6.conf.all.stable_secret"
    sysctl: reading key "net.ipv6.conf.default.stable_secret"
    sysctl: reading key "net.ipv6.conf.docker0.stable_secret"
    sysctl: reading key "net.ipv6.conf.enp2s0.stable_secret"
    sysctl: reading key "net.ipv6.conf.lo.stable_secret"
    sysctl: reading key "net.ipv6.conf.wlp3s0.stable_secret"
    vm.max_map_count = 262144


    Since I am both ignoring info about unknown keys (i.e. the --ignore option) and redirecting potential error output to /dev/null, what are these reading jey lines printed?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I want to grep a particular kernel setting as follows



      $ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null
      sysctl: reading key "net.ipv6.conf.all.stable_secret"
      sysctl: reading key "net.ipv6.conf.default.stable_secret"
      sysctl: reading key "net.ipv6.conf.docker0.stable_secret"
      sysctl: reading key "net.ipv6.conf.enp2s0.stable_secret"
      sysctl: reading key "net.ipv6.conf.lo.stable_secret"
      sysctl: reading key "net.ipv6.conf.wlp3s0.stable_secret"
      vm.max_map_count = 262144


      Since I am both ignoring info about unknown keys (i.e. the --ignore option) and redirecting potential error output to /dev/null, what are these reading jey lines printed?










      share|improve this question













      I want to grep a particular kernel setting as follows



      $ sudo sysctl -a --ignore | grep -i max_map_count 2>/dev/null
      sysctl: reading key "net.ipv6.conf.all.stable_secret"
      sysctl: reading key "net.ipv6.conf.default.stable_secret"
      sysctl: reading key "net.ipv6.conf.docker0.stable_secret"
      sysctl: reading key "net.ipv6.conf.enp2s0.stable_secret"
      sysctl: reading key "net.ipv6.conf.lo.stable_secret"
      sysctl: reading key "net.ipv6.conf.wlp3s0.stable_secret"
      vm.max_map_count = 262144


      Since I am both ignoring info about unknown keys (i.e. the --ignore option) and redirecting potential error output to /dev/null, what are these reading jey lines printed?







      io-redirection sysctl






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      pkaramol

      396113




      396113




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try



          sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count





          share|improve this answer



























            up vote
            3
            down vote













            An explanation of the stable_secrect messages can be found here. In short, the keys exist but are not initialized causing the message.



            Concerning your actual command and goal, the pipe | only redirects stdout not stderr which is printed before the rest is sent to the pipe.

            To have the expected behaviour you could use one of the commands as follows.



            sudo sysctl -a --ignore 2> /dev/null | grep max_map_count
            sudo sysctl -a --ignore 2>&1 | grep max_map_count
            sudo sysctl -a --ignore |& grep max_map_count


            Alternatively you also could use find.



            find /proc/sys -name '*max_map_count*' -exec grep -H . "" ;


            Better would be, as you already know what you are searching for.



            sysctl vm.max_map_count





            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              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',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473660%2fsysctl-command-returning-info-not-asked-about%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              6
              down vote



              accepted










              You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try



              sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count





              share|improve this answer
























                up vote
                6
                down vote



                accepted










                You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try



                sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count





                share|improve this answer






















                  up vote
                  6
                  down vote



                  accepted







                  up vote
                  6
                  down vote



                  accepted






                  You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try



                  sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count





                  share|improve this answer












                  You are redirecting the stderr of the grep to /dev/null but the stderr messages are coming from sysctl. Try



                  sudo sysctl -a --ignore 2>/dev/null | grep -i max_map_count






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 5 hours ago









                  Doug O'Neal

                  2,7521716




                  2,7521716






















                      up vote
                      3
                      down vote













                      An explanation of the stable_secrect messages can be found here. In short, the keys exist but are not initialized causing the message.



                      Concerning your actual command and goal, the pipe | only redirects stdout not stderr which is printed before the rest is sent to the pipe.

                      To have the expected behaviour you could use one of the commands as follows.



                      sudo sysctl -a --ignore 2> /dev/null | grep max_map_count
                      sudo sysctl -a --ignore 2>&1 | grep max_map_count
                      sudo sysctl -a --ignore |& grep max_map_count


                      Alternatively you also could use find.



                      find /proc/sys -name '*max_map_count*' -exec grep -H . "" ;


                      Better would be, as you already know what you are searching for.



                      sysctl vm.max_map_count





                      share|improve this answer
























                        up vote
                        3
                        down vote













                        An explanation of the stable_secrect messages can be found here. In short, the keys exist but are not initialized causing the message.



                        Concerning your actual command and goal, the pipe | only redirects stdout not stderr which is printed before the rest is sent to the pipe.

                        To have the expected behaviour you could use one of the commands as follows.



                        sudo sysctl -a --ignore 2> /dev/null | grep max_map_count
                        sudo sysctl -a --ignore 2>&1 | grep max_map_count
                        sudo sysctl -a --ignore |& grep max_map_count


                        Alternatively you also could use find.



                        find /proc/sys -name '*max_map_count*' -exec grep -H . "" ;


                        Better would be, as you already know what you are searching for.



                        sysctl vm.max_map_count





                        share|improve this answer






















                          up vote
                          3
                          down vote










                          up vote
                          3
                          down vote









                          An explanation of the stable_secrect messages can be found here. In short, the keys exist but are not initialized causing the message.



                          Concerning your actual command and goal, the pipe | only redirects stdout not stderr which is printed before the rest is sent to the pipe.

                          To have the expected behaviour you could use one of the commands as follows.



                          sudo sysctl -a --ignore 2> /dev/null | grep max_map_count
                          sudo sysctl -a --ignore 2>&1 | grep max_map_count
                          sudo sysctl -a --ignore |& grep max_map_count


                          Alternatively you also could use find.



                          find /proc/sys -name '*max_map_count*' -exec grep -H . "" ;


                          Better would be, as you already know what you are searching for.



                          sysctl vm.max_map_count





                          share|improve this answer












                          An explanation of the stable_secrect messages can be found here. In short, the keys exist but are not initialized causing the message.



                          Concerning your actual command and goal, the pipe | only redirects stdout not stderr which is printed before the rest is sent to the pipe.

                          To have the expected behaviour you could use one of the commands as follows.



                          sudo sysctl -a --ignore 2> /dev/null | grep max_map_count
                          sudo sysctl -a --ignore 2>&1 | grep max_map_count
                          sudo sysctl -a --ignore |& grep max_map_count


                          Alternatively you also could use find.



                          find /proc/sys -name '*max_map_count*' -exec grep -H . "" ;


                          Better would be, as you already know what you are searching for.



                          sysctl vm.max_map_count






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 5 hours ago









                          Thomas

                          3,67141225




                          3,67141225



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473660%2fsysctl-command-returning-info-not-asked-about%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              Confectionery