修改可以在页面配置 grep 过滤条件
This commit is contained in:
@@ -1156,8 +1156,7 @@ public class ProcessUtil
|
|||||||
*/
|
*/
|
||||||
public static List<String> getLinuxProcessId(String procSearchKey)
|
public static List<String> getLinuxProcessId(String procSearchKey)
|
||||||
{
|
{
|
||||||
String cmd = "ps -ef | grep -i '" + procSearchKey.trim()
|
String cmd = "ps -ef | grep " + procSearchKey.trim() + " | grep -v grep | awk '{print $2}'";
|
||||||
+ "' | grep -v grep | awk '{print $2}'";
|
|
||||||
logger.info("getLinuxProcessId-----" + cmd);
|
logger.info("getLinuxProcessId-----" + cmd);
|
||||||
String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd };
|
String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd };
|
||||||
BufferedReader bReader = null;
|
BufferedReader bReader = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user