Using Geektool I want to output some of the stats that top spits out on my desktop, but not all of them. Rather than calling top | grep "Line_I_want_to_spit_out" for each different line I want it to show(resulting in 5-6 separate calls to top), is it possible to just call top once and select the lines I want it to show? (ex. show Processes, CPU usage, PhysMem, and the top 10 processes ordered by cpu)
Asked
Active
Viewed 168 times
0
flapjacks
- 117
- 5
-
Which lines do you want to display? – Dennis Feb 13 '13 at 20:55
-
Processes, CPU usage, PhysMem, Networks and 10 processes ordered by cpu usage – flapjacks Feb 13 '13 at 21:15
-
On the command line, `top | grep PATTERN` keeps refreshing, rather than just producing a single static output. Is this what you want? (I'm not familiar with Geektool.) – Dennis Feb 13 '13 at 21:22
2 Answers
1
If you're not averse to using grep, you can do something like top | grep -E "Line1|Line2|etc"
BowlesCR
- 2,697
- 12
- 19
-
That definitely works for the information on top. Do you know if it's possible to also have it show the top 10 processes ordered by cpu usage (top -n10 -o-CPU -stats cpu,command)? Or would that have to be a second call to top? – flapjacks Feb 13 '13 at 21:18
-1
-
1While this might answer the question it might be good to break out and explain the separate parts to educate as well as answer the question. – Mokubai Dec 13 '16 at 07:22