- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- percent cpu via ps auxw (berkely syntax)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2001 10:03 AM
тАО08-27-2001 10:03 AM
pulling off the %cpu column. Does anyone know how to get this info, and I don't want to use "top". I need to be able to gather this data from a script.
Thanks - Jim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2001 10:15 AM
тАО08-27-2001 10:15 AM
Re: percent cpu via ps auxw (berkely syntax)
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2001 10:25 AM
тАО08-27-2001 10:25 AM
SolutionTry using the UNIX95 option of the 'ps' command like this:
# UNIX95= ps -e -o pcpu -o ruser -o args|sort -nr|grep -v %CPU|head -10
This will give the top-10 highest %CPU entries. All processes are selected; the percentage CPU; login name and command line are reported, sorted by descending CPU utilization.
Note that there is a space (blank) after 'UNIX95' before the 'ps' command. Thus, the UNIX95 variable is used *only* for the 'ps' command and no other.
See the man pages for 'ps' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2001 09:23 AM
тАО08-28-2001 09:23 AM
Re: percent cpu via ps auxw (berkely syntax)
When I run your command, I get the first 10 processes. Not the top 10 for cpu usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-02-2001 11:54 AM
тАО09-02-2001 11:54 AM
Re: percent cpu via ps auxw (berkely syntax)
A better choice is to sort the process by accumulated CPU time as in:
UNIX95= ps -eo time,ruser,args | sort | more
To better see the relationship of all processes to each other, you can use Glance or top (Glance is much more useful). You can sort the interesting processes by CPU usage.
Bill Hassell, sysadmin