- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: only show some processes
Operating System - Linux
1752600
Members
4796
Online
108788
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
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
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
тАО04-08-2010 01:56 PM
тАО04-08-2010 01:56 PM
only show some processes
hi
I have to display some interesting data for a menu
so I was checking the "top command"
so I decided that top commands display everything I need but I want o display only the top information not the rest I mean only the 4 first lines like I pasted on this thread..
top - 15:46:23 up 186 days, 5:14, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 114 total, 1 running, 113 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.5%us, 0.2%sy, 0.0%ni, 98.2%id, 1.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 2075500k total, 1741508k used, 333992k free, 339992k buffers
Swap: 3047416k total, 64k used, 3047352k free, 1140164k cached
how can I do that? I want to only display those values and I need it to be updated
thanks a lot
I have to display some interesting data for a menu
so I was checking the "top command"
so I decided that top commands display everything I need but I want o display only the top information not the rest I mean only the 4 first lines like I pasted on this thread..
top - 15:46:23 up 186 days, 5:14, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 114 total, 1 running, 113 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.5%us, 0.2%sy, 0.0%ni, 98.2%id, 1.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 2075500k total, 1741508k used, 333992k free, 339992k buffers
Swap: 3047416k total, 64k used, 3047352k free, 1140164k cached
how can I do that? I want to only display those values and I need it to be updated
thanks a lot
Didn't your momma teach you to say thanks!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2010 03:21 PM
тАО04-08-2010 03:21 PM
Re: only show some processes
Actually, your example shows 5 lines, not 4.
How about:
top -b | head -5
How about:
top -b | head -5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2010 04:52 PM
тАО04-08-2010 04:52 PM
Re: only show some processes
thanks someone else provided me these 2
1. it has the option to press q to exit
VAR=x ; while [ "${VAR}" != 'q' ] ; do top | head -4 ; read -sn 1 -t 2 VAR ; done
2. no q option to exit
watch -n 2 'top -b -n1| head -n 4'
the point for both is they don't really update the CPU options
anyway to fix that?
1. it has the option to press q to exit
VAR=x ; while [ "${VAR}" != 'q' ] ; do top | head -4 ; read -sn 1 -t 2 VAR ; done
2. no q option to exit
watch -n 2 'top -b -n1| head -n 4'
the point for both is they don't really update the CPU options
anyway to fix that?
Didn't your momma teach you to say thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2010 11:26 PM
тАО04-08-2010 11:26 PM
Re: only show some processes
You want only the upper lines?
LINES=5 top
Regards,
Goran
LINES=5 top
Regards,
Goran
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP