Remove system information from iostat command output

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











up vote
0
down vote

favorite












I am trying to get some I/O stats about the partitions on the system using iostat command as follows:



iostat -d /dev/sda


The output appears as follows:



Linux 4.10.0-33-generic (test) Tuesday 26 September 2017 _x86_64_ (1 CPU)

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 9.35 199.58 70.14 603985 212248


Is there any way to get the output without the first line (which displays all system info)?



I have looked up many places, but could not find this option anywhere. I am not very familiar with Linux commands.










share|improve this question













migrated from stackoverflow.com Sep 26 '17 at 4:01


This question came from our site for professional and enthusiast programmers.


















    up vote
    0
    down vote

    favorite












    I am trying to get some I/O stats about the partitions on the system using iostat command as follows:



    iostat -d /dev/sda


    The output appears as follows:



    Linux 4.10.0-33-generic (test) Tuesday 26 September 2017 _x86_64_ (1 CPU)

    Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
    sda 9.35 199.58 70.14 603985 212248


    Is there any way to get the output without the first line (which displays all system info)?



    I have looked up many places, but could not find this option anywhere. I am not very familiar with Linux commands.










    share|improve this question













    migrated from stackoverflow.com Sep 26 '17 at 4:01


    This question came from our site for professional and enthusiast programmers.
















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to get some I/O stats about the partitions on the system using iostat command as follows:



      iostat -d /dev/sda


      The output appears as follows:



      Linux 4.10.0-33-generic (test) Tuesday 26 September 2017 _x86_64_ (1 CPU)

      Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
      sda 9.35 199.58 70.14 603985 212248


      Is there any way to get the output without the first line (which displays all system info)?



      I have looked up many places, but could not find this option anywhere. I am not very familiar with Linux commands.










      share|improve this question













      I am trying to get some I/O stats about the partitions on the system using iostat command as follows:



      iostat -d /dev/sda


      The output appears as follows:



      Linux 4.10.0-33-generic (test) Tuesday 26 September 2017 _x86_64_ (1 CPU)

      Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
      sda 9.35 199.58 70.14 603985 212248


      Is there any way to get the output without the first line (which displays all system info)?



      I have looked up many places, but could not find this option anywhere. I am not very familiar with Linux commands.







      linux iostat






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 25 '17 at 20:16







      Akshay











      migrated from stackoverflow.com Sep 26 '17 at 4:01


      This question came from our site for professional and enthusiast programmers.






      migrated from stackoverflow.com Sep 26 '17 at 4:01


      This question came from our site for professional and enthusiast programmers.






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          You can pipe the standard output of your command to sed to remove the first line. For example:



          iostat | sed '1d'


          If you want to remove the first two lines, the command could be:



          iostat | sed '1d;2d'


          It could also be:



          iostat | sed '1,2d'


          I found a documentation for sed here: https://www.gnu.org/software/sed/manual/sed.html.






          share|improve this answer



























            up vote
            1
            down vote













            A way to do this with just tail:



            iostat -d /dev/sda | tail -n +3


            This removes the first two lines, if you truly only want the first line removed use:



            iostat -d /dev/sda | tail -n +2





            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%2f394451%2fremove-system-information-from-iostat-command-output%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
              1
              down vote













              You can pipe the standard output of your command to sed to remove the first line. For example:



              iostat | sed '1d'


              If you want to remove the first two lines, the command could be:



              iostat | sed '1d;2d'


              It could also be:



              iostat | sed '1,2d'


              I found a documentation for sed here: https://www.gnu.org/software/sed/manual/sed.html.






              share|improve this answer
























                up vote
                1
                down vote













                You can pipe the standard output of your command to sed to remove the first line. For example:



                iostat | sed '1d'


                If you want to remove the first two lines, the command could be:



                iostat | sed '1d;2d'


                It could also be:



                iostat | sed '1,2d'


                I found a documentation for sed here: https://www.gnu.org/software/sed/manual/sed.html.






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  You can pipe the standard output of your command to sed to remove the first line. For example:



                  iostat | sed '1d'


                  If you want to remove the first two lines, the command could be:



                  iostat | sed '1d;2d'


                  It could also be:



                  iostat | sed '1,2d'


                  I found a documentation for sed here: https://www.gnu.org/software/sed/manual/sed.html.






                  share|improve this answer












                  You can pipe the standard output of your command to sed to remove the first line. For example:



                  iostat | sed '1d'


                  If you want to remove the first two lines, the command could be:



                  iostat | sed '1d;2d'


                  It could also be:



                  iostat | sed '1,2d'


                  I found a documentation for sed here: https://www.gnu.org/software/sed/manual/sed.html.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 25 '17 at 20:49







                  YoBa7





























                      up vote
                      1
                      down vote













                      A way to do this with just tail:



                      iostat -d /dev/sda | tail -n +3


                      This removes the first two lines, if you truly only want the first line removed use:



                      iostat -d /dev/sda | tail -n +2





                      share|improve this answer
























                        up vote
                        1
                        down vote













                        A way to do this with just tail:



                        iostat -d /dev/sda | tail -n +3


                        This removes the first two lines, if you truly only want the first line removed use:



                        iostat -d /dev/sda | tail -n +2





                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          A way to do this with just tail:



                          iostat -d /dev/sda | tail -n +3


                          This removes the first two lines, if you truly only want the first line removed use:



                          iostat -d /dev/sda | tail -n +2





                          share|improve this answer












                          A way to do this with just tail:



                          iostat -d /dev/sda | tail -n +3


                          This removes the first two lines, if you truly only want the first line removed use:



                          iostat -d /dev/sda | tail -n +2






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 26 '17 at 7:36









                          Hitechcomputergeek

                          38616




                          38616



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394451%2fremove-system-information-from-iostat-command-output%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay