pidof

发布时间: 更新时间: 总字数:134 阅读时间:1m 作者: IP属地: 分享 复制网址

pidof – find the process ID of a running program.

Help

pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]]  [-o omitpid[,omitpid..]..]  program [program..]

参数

  • -s:仅返回一个进程号
  • -c:仅显示具有相同目录的进程
  • -x:显示由脚本开启的进程
  • -o:指定不显示的进程ID

示例

# ps -ef | grep tengine | grep -v grep
root      4700     1  0 May12 ?        00:00:00 nginx: master process /usr/sbin/tengine -c /etc/tengine/tengine.conf
tengine   6469  4700  0 Jul28 ?        00:00:03 nginx: worker process
# pidof tengine
6469 4700
# pidof -s tengine
6469
# pidof -c tengine
6469 4700
# pidof -x tengine
6469 4700
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数