On Mar 3, 2012 2:44 AM, "Grant Edwards" wrote: > > On 2012-03-02, 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 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,