home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / aix / 13831 < prev    next >
Encoding:
Internet Message Format  |  1993-01-29  |  1.5 KB

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