View the process number
# ps -ef | grep java
root 3697 3640 11 09:33 pts/1 00:00:31 java -jar eureka-server-0.0.1-SNAPSHOT.jar
#View the port occupied by the process
# netstat -tupln | grep 3697
tcp6 0 0 :::1111 :::* LISTEN 3697/java
Find directory: find / (find scope) -name '*find key*' -type d
The process tree relationship in normal operation is as follows (for simplicity, only some processes are displayed):
$ ps x
PID TTY STAT TIME COMMAND
17279 pts/8 Ss 0:00 -bash
18618 pts/8 R+ 0:00 ps xf
18283 pts/8 S 0:00 A
18284 pts/8 S 0:00 A
18321 pts/8 S 0:00 a
18322 pts/8 S 0:00 a
The status of the process at the time of the problem is:
$ ps x
PID TTY STAT TIME COMMAND
17279 pts /8 Ss 0:00 -bash
18618 pts/8 R+ 0:00 ps xf
18283 pts/8 Z 0:00 A<defunct>
18284 pts/8 S 0:00 A
18321 pts/8 S 0:00 a
18322 pts /8 S 0:00 a
The way to find the startup path of a process is:
1. We can get the PID of the zombie process from the ps command, such as 18283 in the above example.
2. Enter the directory named after the PID under the /proc directory
3. Enter ls -l, the exe link in the result corresponds to the full path of the executable file
$ ls -l /proc/18283
total 0
dr-xr-xr-x 2 qhkf qhkf 0 01-06 11:14 attr
- r------- 1 qhkf qhkf 0 01-06 11:14 auxv
-r--r--r-- 1 qhkf qhkf 0 01-06 10:38 cmdline
-r--r--r- - 1 qhkf qhkf 0 01-06 11:14 cpuset
lrwxrwxrwx 1 qhkf qhkf 0 01-06 11:14 cwd -> /v8t/qhkf/risk_b/kssmdb