Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-03 Thread Tanstaafl
On 2012-03-02 4:52 PM, Paul Hartman wrote: On Fri, Mar 2, 2012 at 3:23 PM, Tanstaafl wrote: Attempt at incorporating your command into this: watch -n1 "ps aux --sort=-%cpu | gawk 'NR==1; $3> 0'" it gives me a syntax error: Every 1.0s: ps aux --sort=-%cpu | gawk 'NR==1;>0'

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Paul Hartman
On Fri, Mar 2, 2012 at 3:23 PM, Tanstaafl wrote: > On 2012-03-02 3:50 PM, Paul Hartman wrote: >> >> On Fri, Mar 2, 2012 at 2:39 PM, Tanstaafl >>  wrote: >>> >>> On 2012-03-02 2:33 PM, Paul Hartman >>>  wrote: And you can use the --sort options for ps to sort by cpu or anything

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
On 2012-03-02 3:50 PM, Paul Hartman wrote: On Fri, Mar 2, 2012 at 2:39 PM, Tanstaafl wrote: On 2012-03-02 2:33 PM, Paul Hartman wrote: And you can use the --sort options for ps to sort by cpu or anything you like (see the manpage) Even better, thanks Paul... watch -n1 "ps aux --sort=-%c

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Paul Hartman
On Fri, Mar 2, 2012 at 2:39 PM, Tanstaafl wrote: > On 2012-03-02 2:33 PM, Paul Hartman wrote: >> >> And you can use the --sort options for ps to sort by cpu or anything >> you like (see the manpage) > > > Even better, thanks Paul... > > watch -n1 "ps aux --sort=-%cpu | gawk '{ if ( \$3 > 1.0 ) {

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
On 2012-03-02 2:33 PM, Paul Hartman wrote: And you can use the --sort options for ps to sort by cpu or anything you like (see the manpage) Even better, thanks Paul... watch -n1 "ps aux --sort=-%cpu | gawk '{ if ( \$3 > 1.0 ) { print } }'" does exactly what I want... Hmmm... is there an easy

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Paul Hartman
On Fri, Mar 2, 2012 at 12:32 PM, Tanstaafl wrote: > On 2012-03-02 1:12 PM, Jason wrote: >> >> On Fri, Mar 02, 2012 at 01:03:55PM -0500, Tanstaafl wrote: >>> >>> Also - would there be a way to get a running output (kind of like >>> tailing a log)? >> >> >> watch -n1 "ps aux | gawk '{ if ( \$3>  1.

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Paul Hartman
On Fri, Mar 2, 2012 at 12:24 PM, Pandu Poluan wrote: > > On Mar 3, 2012 1:07 AM, "Paul Hartman" > wrote: >> >> On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl >> 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 co

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
On 2012-03-02 1:12 PM, Jason wrote: On Fri, Mar 02, 2012 at 01:03:55PM -0500, Tanstaafl wrote: Also - would there be a way to get a running output (kind of like tailing a log)? watch -n1 "ps aux | gawk '{ if ( \$3> 1.0 ) { print } }'" Perfect!!! Thanks so much guys!

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Alan McKinnon
On Fri, 02 Mar 2012 13:12:04 -0500 Tanstaafl wrote: > On 2012-03-02 1:02 PM, Paul Hartman > wrote: > > On Fri, Mar 2, 2012 at 11:46 AM, > > Tanstaafl 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 >

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Pandu Poluan
On Mar 3, 2012 1:07 AM, "Paul Hartman" wrote: > > On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl 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

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Jason
On Fri, Mar 02, 2012 at 01:03:55PM -0500, Tanstaafl wrote: > Also - would there be a way to get a running output (kind of like > tailing a log)? watch -n1 "ps aux | gawk '{ if ( \$3 > 1.0 ) { print } }'"

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
On 2012-03-02 1:02 PM, Paul Hartman wrote: On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl 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 | gaw

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
On 2012-03-02 12:56 PM, Pandu Poluan wrote: On Mar 3, 2012 12:49 AM, "Tanstaafl" mailto:tansta...@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 somethin

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Paul Hartman
On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl 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 } }'

Re: [gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Pandu Poluan
On Mar 3, 2012 12:49 AM, "Tanstaafl" 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? > > Thanks > For that, you need awk instead of grep. Rgds,

[gentoo-user] Filter grep output of 'ps aux'

2012-03-02 Thread Tanstaafl
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? Thanks