Remove system information from iostat command output
Clash 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.
linux iostat
migrated from stackoverflow.com Sep 26 '17 at 4:01
This question came from our site for professional and enthusiast programmers.
add a comment |Â
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.
linux iostat
migrated from stackoverflow.com Sep 26 '17 at 4:01
This question came from our site for professional and enthusiast programmers.
add a comment |Â
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.
linux iostat
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
linux iostat
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.
add a comment |Â
add a comment |Â
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.
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered Sep 25 '17 at 20:49
YoBa7
add a comment |Â
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered Sep 26 '17 at 7:36
Hitechcomputergeek
38616
38616
add a comment |Â
add a comment |Â
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
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
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
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
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