On Mar 3, 2012 2:44 AM, "Grant Edwards" <grant.b.edwards@gmail.com> wrote:
>
> On 2012-03-02, Pandu Poluan <pandu@poluan.info> wrote:
> > On Mar 3, 2012 1:07 AM, "Paul Hartman" <paul.hartman+gentoo@gmail.com>
> > wrote:
> >>
> >> On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl <tanstaafl@libertytrek.org>
> > wrote:
> >> > Does anyone know if there is a way to filter the output of ps aux to
> > show
> >> > only lines that have a value in the %CPU column higher than x - ie,
> > 1.0, or
> >> > 2.0, or something like that?
> >>
> >> ps aux | gawk '{ if ( $3 > 1.0 ) { print } }'
> >>
> >
> > Why would you use "if"? You can easily use this :
> >
> > ps aux | awk '$3 > 1.0 {print}'
>
> Why would you use "{print}"? You can easily use this:
>
> ps aux | awk '$3 > 1.0'
>
> ;)
>
Ahaha, true... that's the default action if no action block is provided. I usually just print the fields I need in the action block.
Rgds,