home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3180 < prev    next >
Encoding:
Text File  |  1992-07-29  |  879 b   |  24 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!news
  3. From: peer@ccrma.stanford.edu (Peer Landa)
  4. Subject: Re: Sort problem . .
  5. Message-ID: <1992Jul29.160600.9623@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: DSO, Stanford University
  8. References: <1992Jul29.072924*Harald.Eikrem@delab.sintef.no>
  9. Date: Wed, 29 Jul 92 16:06:00 GMT
  10. Lines: 12
  11.  
  12.  
  13. It seems like this is getting out of hand, or drifting away from my original  
  14. posting . . where I asked to get a command line (or script) to list & sort all  
  15. my processes by memory use without getting the "title line" on the bottom --  
  16. i.e the "title line" shall stay at the top (that's why 'ps uax | sort -nr +3'  
  17. doesn't work). One way to do this (thanks to Erick Rudiak) is: 
  18. TITLELINE=`ps aux | head -1`
  19. echo "$TITLELINE"
  20. ps -aux | grep -v PID | sort -rn +3
  21.  
  22. -- peer
  23.  
  24.