java 如何使用进程 ID 获取有关 linux 进程的更多详细信息?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13645754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 13:29:42  来源:igfitidea点击:

How to get more details about the linux process using process Id?

javaubuntuprocessgrepkill

提问by milind_db

I want to get more details about the processes running on the ubuntu system.

我想获得有关在 ubuntu 系统上运行的进程的更多详细信息。

e.g. I want to kill one javaprocess, but there are multiple java processes are running on my machine, so How can I identify correct one which I want?

例如,我想杀死一个java进程,但是我的机器上正在运行多个 java 进程,那么我如何确定我想要的正确的一个?

I tried ps -ae | grep javawhich gives me all the java processes which are running, which contains tomcat, eclipse, and the one which I want to kill, but I do not understand which process to be killed?

我试过ps -ae | grep java它给了我所有正在运行的java进程,其中包含tomcat、eclipse和我想杀死的那个进程,但我不明白要杀死哪个进程?

Is there any way available to get the more details about specific process i.e. process name, its start time etc.

有什么方法可以获得有关特定进程的更多详细信息,即进程名称、开始时间等。

thanks in advance...

提前致谢...

回答by Anders R. Bystrup

With the psutility you can use e.g. ps auxwwwto get a lot of detail, or you may use the jpsutility to list the java processes running, eg.:

使用该ps实用程序,您可以使用例如ps auxwww获取大量详细信息,或者您可以使用该jps实用程序列出正在运行的 Java 进程,例如:

localhost:~# jps -v
2734 Bootstrap -Djava.util.logging.config.file=/opt/tomcat-6/....
2933 Launcher -Dsun.net.inetaddr.ttl=3600 -DbundleBasedir=....
10255 Jps -Dapplication.home=/usr/lib/jvm/java-6-sun-1.6.0.26 -Xms8m

Cheers,

干杯,

回答by Jordi Laforge

I usually use

我通常使用

ps -ax|grep somethingIKnowAboutTCPOrTheArguments

ps -ax|grep somethingIKnowAboutTCPOrTheArguments

Normally the processes are launched in different directories or have a different starting-arguement. I use this to select on of my tomcats/java/....-process

通常,进程在不同的目录中启动或具有不同的起始参数。我用它来选择我的 tomcats/java/....-process