Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:24:33+00:00 2026-06-11T12:24:33+00:00

I am trying to catch some data from iostat output: # iostat -m avg-cpu:

  • 0

I am trying to catch some data from iostat output:

# iostat  -m

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           9.92    0.00   14.17    0.01    0.00   75.90

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               6.08         0.00         0.04       2533     261072
dm-0              1.12         0.00         0.00       1290      30622
dm-1              0.00         0.00         0.00          1          0
dm-2              1.22         0.00         0.00          0      33735
dm-3              7.22         0.00         0.03       1213     196713

How can I match the “0.00” value?
Numbers aren’t separated by a tab or a constant number of spaces.
Also the value can be 3 digits 0.00 or 4 digits 45.00, etc.

Any idea how to match it using bash?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:24:34+00:00Added an answer on June 11, 2026 at 12:24 pm

    Try this, using awk:

    iostat | awk 'NR==3 { print $5 }'
    

    NR==3 will operate on the third line, and $5 prints column 5. Verify that the proper column is being selected by playing around with the number, i.e. using your output and print $4 should yield 0.01.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to wrap up some data from an array of BYTES into
I'm trying to receive some data from a client in a server using Google
I'm trying to get some json data from a remote website. I run my
I'm trying to pull some binary data from a database and write them to
I'm trying to extract some data from XML using Linq to XML, and I
i am trying to read in some data from an excel: If (FileUpload1.PostedFile.ContentType =
I'm trying to read XML data from Google weather webservice. The response contain some
I'm trying to retrive some data from a web site . I wrote a
I am currently trying to get my program to input data from a user-defined
I'm trying to pass some data from one activity to a new one but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.