1 |
On Fri, Mar 2, 2012 at 2:39 PM, Tanstaafl <tanstaafl@×××××××××××.org> wrote: |
2 |
> On 2012-03-02 2:33 PM, Paul Hartman <paul.hartman+gentoo@×××××.com> wrote: |
3 |
>> |
4 |
>> And you can use the --sort options for ps to sort by cpu or anything |
5 |
>> you like (see the manpage) |
6 |
> |
7 |
> |
8 |
> Even better, thanks Paul... |
9 |
> |
10 |
> watch -n1 "ps aux --sort=-%cpu | gawk '{ if ( \$3 > 1.0 ) { print } }'" |
11 |
> |
12 |
> does exactly what I want... |
13 |
> |
14 |
> Hmmm... is there an easy way to include the column headers? |
15 |
|
16 |
To build on Grant's suggestion: |
17 |
ps aux --sort %cpu | gawk 'NR==1; $3 > 0' |