2

I want to get all the info from Activity Monitor in the terminal (because I am executing these commands in macOS app). It also has to terminate - e.g. for top I can write:

top -pid <somepid> -l3 -n30 > test ; tail -n42 ./test > ./test2 ; open ./test2

and this would get 3 recordings and terminate.

So far, I managed to run top command and get most of the metrics. However, there are many that top doesn't provide, such as GPU and networking.

I am familiar with systemstats but this is not on a per-process basis. I can grep some parts of systemstats, but there is not guarantee that my process is going to be in the list of GPU usage section.

Need to support 10.14 Mojave and 10.15 Catalina

Any other commands that I can use, or maybe ways I can tweak systemstats to work for my case?

1
  • netstat : This command shows network status

  • iostat : This command displays information about CPU usage, and I/O statistics

  • vm_stat : This command virtual memory statistics

To my knowledge, there is no command to get GPU usage on macOS.

| improve this answer | |
  • OK, I am familiar with some of them, but they don't satisfy my requirements. First, they aren't on a per-process basis. Second, I need something that terminates and gives the results. – Dragos Strugar Feb 9 at 16:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .