A windows operation command
1. Check the information of a port
netstat -aon | findstr "port"
2. View the application name corresponding to the PID
tasklist | findstr "PID"
3. taskkill /f /t /im process name
Then end the process: taskkill /f /t /im program name.exe
(Of course, you can also specify the pid to kill the process or use the resource manager to kill the process, such as: tasklist /fi "PID eq 5052")
Two linux operation commands
1. Used to view the process status of the specified port number netstat -tunlp |grep 80
[root@iZm5ef5z7h5ttemtom1r9oZ cron]# netstat -tunlp |grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2164/nginx: master
tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 2164/nginx: master
tcp6 0 0 :::8085 :::* LISTEN 11996/java
2. Check a process ps -ef | grep kvf | grep -v grep (grep -v grep is to remove redundant items containing grep)
[root@iZm5ef5z7h5ttemtom1r9oZ cron]# ps -ef | grep kvf | grep -v grep
root 11996 1 0 12:08 ? 00:00:39 java -jar kvf-admin.jar -Dspring.profiles.active=prod
3. View the usage of CPU and memory
use the top command
PID: ID of the process
USER: process owner
PR: The priority level of the process, the smaller the priority is executed
NInice: value
VIRT: The virtual memory occupied by the process
RES: the physical memory occupied by the process
SHR: shared memory used by the process
S: The state of the process. S means sleep, R means running, Z means dead state, N means the process priority value is negative
%CPU: The CPU usage rate occupied by the process
%MEM: The percentage of physical memory and total memory used by the process
TIME+: The total CPU time occupied by the process after it starts, that is, the accumulated value of the occupied CPU usage time.
COMMAND: process start command name
4. Check memory: free
total: total physical memory size.
used: How much has been used.
free: How many are available.
Shared: The total amount of memory shared by multiple processes.
Buffers/cached: The size of the disk cache.