码迷,mamicode.com
首页 > 系统相关 > 详细

shell命令获取tomcat的进程号id

时间:2016-04-25 17:47:26      阅读:1624      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!