Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to find the corresponding process name and directory method through PID number in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Sometimes you can see that there are individual processes using a large amount of memory through the top command, but top cannot directly see the process name and the directory in which the process is located. So we can locate it in the following ways.

The first thing you need to know is the PID number, which can be obtained through the top command.

Then we can use ps to see the following general information (the information from ps is messy and not easy to find)

[root@iZbp13806tx36fgoq7bzk1Z 28990] # ps-aux | grep-v grep | grep 28990 28990 0.7 14.0 5112056 1128224? Ssl Sep26 231 server 10 / opt/java/bin/java-server-Dinstall4j.jvmDir=/opt/java-Dexe4j.moduleName=/opt/sonatype/nexus/bin/nexus-XX:+UnlockDiagnosticVMOptions-Dinstall4j.launcherId=245-Dinstall4j.swt=false-Di4jv=0-Xms1200m-Xmx1200m-XX:MaxDirectMemorySize=2g-Djava.util.prefs.userRoot=/nexus-data/javaprefs-XX:+UnlockDiagnosticVMOptions-XX:+UnsyncloadClass-XX:+LogVMOutput-XX:LogFile=../sonatype-work/nexus3/log/jvm.log-XX:-OmitStackTraceInFastThrow-Djava.net.preferIPv4Stack=true-Dkaraf.home=. -Dkaraf.base=. Dkaraf.etc=etc/karaf-Djava.util.logging.config.file=etc/karaf/java.util.logging.properties-Dkaraf.data=../sonatype-work/nexus3-Djava.io.tmpdir=../sonatype-work/nexus3/tmp-Dkaraf.startLocalConsole=false-Di4j.vpt=true-classpath / opt/sonatype/nexus/.install4j/i4jruntime.jar:/opt/sonatype/nexus/lib/boot/nexus-main.jar:/opt/sonatype/nexus/lib/boot/org.apache.karaf.main-4.0.9. Jar:/opt/sonatype/nexus/lib/boot/org.osgi.core-6.0.0.jar:/opt/sonatype/nexus/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar:/opt/sonatype/nexus/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar com.install4j.runtime.launcher.UnixLauncher run 9d17dc87 org.sonatype.nexus.karaf.NexusMain [root@iZbp13806tx36fgoq7bzk1Z 28990] #

From the above information, we can also find out that this is a java process, in the / opt/sonatype/nexus/bin/nexus directory, of course, there can be other simpler and more direct methods.

After learning about PID, you can enter / proc/28990 directly.

So you can see it intuitively.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report