Filtering Linux command output

Posted by Raajkumar on Stack Overflow See other posts from Stack Overflow or by Raajkumar
Published on 2011-01-17T11:14:10Z Indexed on 2011/01/17 11:53 UTC
Read the original article Hit count: 174

Filed under:

Hi,

I need to get a row based on column value just like querying a database. I have a command output like this,

Name ID Mem VCPUs State
Time(s)

Domain-0 0 15485 16 r----- 1779042.1

prime95-01 512 1
-b---- 61.9

Here I need to list only those rows where state is "r". Something like this,

Domain-0 0 15485 16
r----- 1779042.1

I have tried using "grep" and "awk" but still I am not able to succeed.

Please help me on this issue.

Regards, Raaj

© Stack Overflow or respective owner

Related posts about linux