0

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)

flapjacks
  • 117

2 Answers2

1

If you're not averse to using grep, you can do something like top | grep -E "Line1|Line2|etc"

BowlesCR
  • 2,723
-1

Use:

ps -arcwwwxo "command %cpu %mem" | grep -v grep | head -9
Gareth
  • 19,080
rob
  • 1