- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- I am looking for a script to run the top command
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
Forums
Discussions
Discussions
Discussions
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
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
05-29-2003 08:30 AM
05-29-2003 08:30 AM
UNIX95= ps -e -o "vsz pcpu ruser pid stime time state args" | sort -rn |head -10
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2003 08:35 AM
05-29-2003 08:35 AM
SolutionI didn't get your requirement. If your idea is to capture the top output into a file, then you can use -f option of top to dump it into file. For ex.,
top -s 5 -d 10 -f top.out
will print 10 top sessions at the interval of 5 seconds.
You may want to consider looking at Glance|gpm. It will give you an extensive output with excellent online help.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2003 08:38 AM
05-29-2003 08:38 AM
Re: I am looking for a script to run the top command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2003 08:44 AM
05-29-2003 08:44 AM
Re: I am looking for a script to run the top command
The script reports the "top-10" processes in terms of memory (core) consumption. The output is sorted in descending size -- largest first.
The option 'UNIX95' is set *only* for the command line -- the 'ps' command. This option is also known as 'XPG4' behavior. The various 'ps' options (e.g. vsz, pcpu, etc) are explained in the 'ps' man pages. The beauty of using the '-o' option is that *you* can choose how you want your output to look and what it should contain.
As Sri already noted, 'top' has a '-f file' option to direct its output into a file that can be parsed.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2003 08:45 AM
05-29-2003 08:45 AM
Re: I am looking for a script to run the top command
Have a look at sar - man sar - also search the for on sar.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2003 09:00 AM
05-29-2003 09:00 AM
Re: I am looking for a script to run the top command
This follows on Paula's suggestion.
I will be updating/improving this package in the next few weeks, but it works pretty well now.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com