If you call the top command, you get all the running processes. But how can I limit the output only to a certain process name like \"java\"?
I\'ve
Using the answer from here I was able to create a one liner
top -pid $(pgrep process_name | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ -pid /g')
This works for me on MacOS 10.12 (Sierra)