From owner-freebsd-questions@FreeBSD.ORG Tue Apr 10 23:36:42 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60F6E16A404 for ; Tue, 10 Apr 2007 23:36:42 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (dsl081-227-250.chi1.dsl.speakeasy.net [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 0513213C45A for ; Tue, 10 Apr 2007 23:36:39 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id l3ANa4qG093437; Tue, 10 Apr 2007 18:36:04 -0500 (CDT) Message-Id: <6.0.0.22.2.20070410183124.024f8b10@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Tue, 10 Apr 2007 18:35:33 -0500 To: Gary Kline , Rick Olson From: Derek Ragona In-Reply-To: <20070410231701.GA35246@thought.org> References: <20070306003506.GA12553@thought.org> <6.0.0.22.2.20070306072709.02577448@mail.computinginnovations.com> <20070306165349.GA67829@thought.org> <461AEE3F.2010107@napalmriot.com> <20070410231701.GA35246@thought.org> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Gary Kline , FreeBSD Mailing List Subject: Re: awk question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 23:36:42 -0000 At 06:17 PM 4/10/2007, Gary Kline wrote: >On Mon, Apr 09, 2007 at 06:54:07PM -0700, Rick Olson wrote: > > I'm assuming you've already taken care of this, but to answer your > > original question in AWK form, you could have done the following: > > > > ls -l | awk '$8 == 2006 {system("rm " $9)}' > > > > i'Ll save your snippet to my growing %%% awk file in my ~/HowTo, > thankee much. I'm in the first stages on a months-long trial on > system tuning. This, before I'd risk publishing anything. So > far tho, by upping and lower the NICE prio of various binaries, I > have been able to get more than 70% efficient use out of my older > servers. ---This *ought* to carry over to my faster machines.... > > Is tthere a way of using ps -alx | ask to look at nice and if it > is non-zero (the default), to reset it to zero? You can easily do some of this using top, such as: top -bS 200 | tail -n +9 | awk '{ print $5 }' If you want to tweak the nice value you'd need to examine the value and then renice it as long as you are root. You'd need the PID for that, so here's another example: top -bS 200 | tail -n +9 | awk '{ printf("Pid: %d has Nice: %d\n", $1,$5) }' -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support.