public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Paul Hartman <paul.hartman+gentoo@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Filter grep output of 'ps aux'
Date: Fri, 2 Mar 2012 13:32:54 -0600	[thread overview]
Message-ID: <CAEH5T2MJdNMAEsrdGzqT4pvjOTShNkx3nG_pcbGoG_CkiWv+8g@mail.gmail.com> (raw)
In-Reply-To: <CAA2qdGVF08n3FgF45yRhDSm0iQk5g0yhnirU6iGy1wG53oy=iA@mail.gmail.com>

On Fri, Mar 2, 2012 at 12:24 PM, 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}'

because I don't know awk very well ;)



  reply	other threads:[~2012-03-02 19:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 17:46 [gentoo-user] Filter grep output of 'ps aux' Tanstaafl
2012-03-02 17:56 ` Pandu Poluan
2012-03-02 18:03   ` Tanstaafl
2012-03-02 18:12     ` Jason
2012-03-02 18:32       ` Tanstaafl
2012-03-02 19:33         ` Paul Hartman
2012-03-02 20:39           ` Tanstaafl
2012-03-02 20:50             ` Paul Hartman
2012-03-02 21:23               ` Tanstaafl
2012-03-02 21:52                 ` Paul Hartman
2012-03-03 13:00                   ` Tanstaafl
2012-03-02 18:02 ` Paul Hartman
2012-03-02 18:12   ` Tanstaafl
2012-03-02 18:30     ` Alan McKinnon
2012-03-02 18:24   ` Pandu Poluan
2012-03-02 19:32     ` Paul Hartman [this message]
2012-03-02 19:40     ` [gentoo-user] " Grant Edwards
2012-03-03  2:16       ` Pandu Poluan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEH5T2MJdNMAEsrdGzqT4pvjOTShNkx3nG_pcbGoG_CkiWv+8g@mail.gmail.com \
    --to=paul.hartman+gentoo@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox