首页 > 系统服务 > 详细

shell命令获取tomcat的进程号id

时间:2016-04-25 17:47:05      阅读:296      评论:0      收藏:0      [点我收藏+]

假设获取tomcat内容相关的进程信息

命令:ps -ef | grep tomcat

技术分享

这个脚本首先用ps -ef | grep tomcat 获得了tomcat进程信息中,这样出来的结果中会包含grep本身,因此通过 | grep -v grep 来排除grep本身,然后通过 awk ‘{print $2}‘来打印出要找的进程id号

命令:ps -ef | grep tomcat | grep -v grep | awk ‘{print $2}‘

技术分享

 

技术分享

shell命令获取tomcat的进程号id

原文:http://www.cnblogs.com/sliuworld/p/5431662.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!