home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!sgiblab!munnari.oz.au!metro!ob1!tscc.macarthur.uws.edu.au!A9000005
- From: A9000005@tscc.macarthur.uws.edu.au
- Newsgroups: comp.unix.aix
- Subject: Re: top command on aix?
- Message-ID: <16B648858.A9000005@tscc.macarthur.uws.edu.au>
- Date: 28 Jan 93 14:41:36 GMT
- References: <01050810.om6677@mbeckman.mbeckman.com>
- Sender: news@uws.EDU.AU
- Organization: University of Western Sydney, Macarthur
- Lines: 29
-
- In article <01050810.om6677@mbeckman.mbeckman.com>
- mbeckman@mbeckman.mbeckman.com (Mel Beckman) writes:
-
- >
- >
- >In article <1993Jan26.141611.19688@jarvis.csri.toronto.edu> (comp.unix.aix), jwang@sys.toronto.edu (Jingwen Wang) writes:
- >>
- >> Is there a command similar to "top" on aix? This command is useful to
- >> find out which processes are consuming most of the cpu time.
- >
- >
- >You can make an alias for the Korn shell to do this:
- >
- > alias top = '(ps u | head -1; ps aux | grep -v PID | sort +2r)'
-
- Great idea! Works well except for one problem. I (AIX 3.1.5) find
- that when a process has more that 9.9% CPU (ie 3 digits), the PID
- and the % CPU become one field and hence, sort puts them at the bottom
- of the list. I pipe this to "head -23" so I only get the 23 most
- hungry processes, this meant that I lost all the big ones!
-
- I replaced the "sort +2r" with "sort +0.14r" to sort from column 14
- on. Column 14 is the first one after PID.
-
- ---
- Brian Watson
- Programmer, Computing Centre
- University of Western Sydney, Macarthur
- Internet: b.watson@uws.edu.au
-