有没有找项目的网站铜仁公司做网站
文章目录
- linux命令--pidof
 
linux命令–pidof
pidof 是Linux系统中用来查找正在运行进程的进程号(pid)的工具,功能类似pgrep和ps。
pidof命令用于查找指定名称的进程的进程号id号。
语法
 pidof(选项)(参数)
 选项
 -s:仅返回一个进程号;
 -c:仅显示具有相同“root”目录的进程;
 -x:显示由脚本开启的进程;
 -o:指定不显示的进程ID。
 参数
 进程名称:指定要查找的进程名称。
实例
# pidof nginx
3189 985 984 983 982
# ps -ef|grep nginx
work       982  3189  0 02:02 ?        00:00:00 nginx: worker process
work       983  3189  0 02:02 ?        00:00:02 nginx: worker process
work       984  3189  0 02:02 ?        00:00:02 nginx: worker process
work       985  3189  0 02:02 ?        00:00:02 nginx: worker process
root      3189     1  0  2018 ?        00:00:02 nginx: master process nginx
root     19020 15396  0 16:45 pts/2    00:00:00 grep --color=auto nginx
1
# pidof -s nginx
3189
