1 |
On Mar 3, 2012 2:44 AM, "Grant Edwards" <grant.b.edwards@×××××.com> wrote: |
2 |
> |
3 |
> On 2012-03-02, Pandu Poluan <pandu@××××××.info> wrote: |
4 |
> > On Mar 3, 2012 1:07 AM, "Paul Hartman" <paul.hartman+gentoo@×××××.com> |
5 |
> > wrote: |
6 |
> >> |
7 |
> >> On Fri, Mar 2, 2012 at 11:46 AM, Tanstaafl <tanstaafl@×××××××××××.org> |
8 |
> > wrote: |
9 |
> >> > Does anyone know if there is a way to filter the output of ps aux to |
10 |
> > show |
11 |
> >> > only lines that have a value in the %CPU column higher than x - ie, |
12 |
> > 1.0, or |
13 |
> >> > 2.0, or something like that? |
14 |
> >> |
15 |
> >> ps aux | gawk '{ if ( $3 > 1.0 ) { print } }' |
16 |
> >> |
17 |
> > |
18 |
> > Why would you use "if"? You can easily use this : |
19 |
> > |
20 |
> > ps aux | awk '$3 > 1.0 {print}' |
21 |
> |
22 |
> Why would you use "{print}"? You can easily use this: |
23 |
> |
24 |
> ps aux | awk '$3 > 1.0' |
25 |
> |
26 |
> ;) |
27 |
> |
28 |
|
29 |
Ahaha, true... that's the default action if no action block is provided. I |
30 |
usually just print the fields I need in the action block. |
31 |
|
32 |
Rgds, |