【linux环境】
方法1:截取进程pid,再kill
ps -ef | grep java.endorsed.dirs | grep -v grep | cut -c10-15 | xargs kill -9
方法2:
1)找到linux下的进程pids
ps -ef | grep eSight | grep -v grep | awk '{print $2}'
2)循环pids,kill -9 pid
【windows】
kill 命令行参数中带tomcat字符串的 java.exe 进程
方法1:
wmic process where (Name="java.exe" AND CommandLine like "%%tomcat%%") call terminate >nul 2>nul
方法2:
C:\Users\j00113584>wmic process where name="calc.exe" get Processid
ProcessId
6848
C:\Users\j00113584>taskkill /F /PID 6848
成功: 已终止 PID 为 6848 的进程。
本文介绍了在Linux和Windows环境下管理特定进程的方法。包括通过ps、grep等命令组合使用来查找并终止Linux上的Java进程,以及利用wmic和taskkill命令来定位并结束Windows上的指定进程。
5万+

被折叠的 条评论
为什么被折叠?



