Gentoo Archives: gentoo-user

From: Grant Edwards <grant.b.edwards@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Filter grep output of 'ps aux'
Date: Fri, 02 Mar 2012 19:42:42
Message-Id: jir7n2$vml$1@dough.gmane.org
In Reply to: Re: [gentoo-user] Filter grep output of 'ps aux' by Pandu Poluan
1 On 2012-03-02, Pandu Poluan <pandu@××××××.info> wrote:
2 > On Mar 3, 2012 1:07 AM, "Paul Hartman" <paul.hartman+gentoo@×××××.com>
3 > wrote:
4 >>
5 >> On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl <tanstaafl@×××××××××××.org>
6 > wrote:
7 >> > Does anyone know if there is a way to filter the output of ps aux to
8 > show
9 >> > only lines that have a value in the %CPU column higher than x - ie,
10 > 1.0, or
11 >> > 2.0, or something like that?
12 >>
13 >> ps aux | gawk '{ if ( $3 > 1.0 ) { print } }'
14 >>
15 >
16 > Why would you use "if"? You can easily use this :
17 >
18 > ps aux | awk '$3 > 1.0 {print}'
19
20 Why would you use "{print}"? You can easily use this:
21
22 ps aux | awk '$3 > 1.0'
23
24 ;)
25
26 --
27 Grant Edwards grant.b.edwards Yow! Kids, don't gross me
28 at off ... "Adventures with
29 gmail.com MENTAL HYGIENE" can be
30 carried too FAR!

Replies

Subject Author
Re: [gentoo-user] Re: Filter grep output of 'ps aux' Pandu Poluan <pandu@××××××.info>