Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Filter grep output of 'ps aux'
Date: Fri, 02 Mar 2012 18:25:28
Message-Id: CAA2qdGVF08n3FgF45yRhDSm0iQk5g0yhnirU6iGy1wG53oy=iA@mail.gmail.com
In Reply to: Re: [gentoo-user] Filter grep output of 'ps aux' by Paul Hartman
1 On Mar 3, 2012 1:07 AM, "Paul Hartman" <paul.hartman+gentoo@×××××.com>
2 wrote:
3 >
4 > On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl <tanstaafl@×××××××××××.org>
5 wrote:
6 > > Does anyone know if there is a way to filter the output of ps aux to
7 show
8 > > only lines that have a value in the %CPU column higher than x - ie,
9 1.0, or
10 > > 2.0, or something like that?
11 >
12 > ps aux | gawk '{ if ( $3 > 1.0 ) { print } }'
13 >
14
15 Why would you use "if"? You can easily use this :
16
17 ps aux | awk '$3 > 1.0 {print}'
18
19 Rgds,

Replies

Subject Author
Re: [gentoo-user] Filter grep output of 'ps aux' Paul Hartman <paul.hartman+gentoo@×××××.com>
[gentoo-user] Re: Filter grep output of 'ps aux' Grant Edwards <grant.b.edwards@×××××.com>