- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to sort the output of the top command
Operating System - HP-UX
1822512
Members
2513
Online
109642
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО09-26-2006 02:25 AM
тАО09-26-2006 02:25 AM
How to sort the output of the top command
When running the top command i will show all the running processes at the top of the list. Is there a way to sort on state and cpu?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2006 02:36 AM
тАО09-26-2006 02:36 AM
Re: How to sort the output of the top command
Probably the best you're going to do using the top command is redirecting it to a file and then sorting that. You'll get the headers and footers in the file too, though.
Why not use ps instead?
ps -elf | sort -nr +5 #sort by cpu
ps -elf | sort -r +1 #sort by state
Why not use ps instead?
ps -elf | sort -nr +5 #sort by cpu
ps -elf | sort -r +1 #sort by state
Decay is inherent in all compounded things. Strive on with diligence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2006 03:12 AM
тАО09-26-2006 03:12 AM
Re: How to sort the output of the top command
Hi Jan,
'top' will not do this interactively. Use 'ps':
# UNIX95= ps -e -o pcpu= -o state= -o pid= -o args= | sort -r -k2,1 | head -20
PCS
'top' will not do this interactively. Use 'ps':
# UNIX95= ps -e -o pcpu= -o state= -o pid= -o args= | sort -r -k2,1 | head -20
PCS
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP