Limit the output of the TOP command to a specific process name

后端 未结 17 2648
臣服心动
臣服心动 2020-12-12 09:48

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

17条回答
  •  遥遥无期
    2020-12-12 10:12

    I solved my problem using:

    top -n1 -b | grep "proccess name"

    in this case: -n is used to set how many times top will what proccess
    and -b is used to show all pids

    it's prevents errors like : top: pid limit (20) exceeded

提交回复
热议问题