List of Java processes

前端 未结 18 2264
长发绾君心
长发绾君心 2020-12-22 16:44

How can I list all Java processes in bash? I need an command line. I know there is command ps but I don\'t know what parameters I need to use.

18条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 17:14

    When I want to know if a certain Java class is getting executed, I use the following command line:

    ps ww -f -C java | grep "fully.qualified.name.of.class"
    

    From the OS side view, the process's command name is "java". The "ww" option widens the colum's maximum characters, so it's possible to grep the FQN of the related class.

提交回复
热议问题