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
just top -bn 1 | grep java will do the trick for you
top -bn 1 | grep java