[root@Nginx_BackUP keepalived]# ps -C nginx
PID TTY TIME CMD
3965 ? 00:00:00 nginx
3966 ? 00:00:00 nginx
3968 ? 00:00:01 nginx
[root@Nginx_BackUP keepalived]# ps -C nginx --no-header
3965 ? 00:00:00 nginx
3966 ? 00:00:00 nginx
3968 ? 00:00:01 nginx
#-C 接命令的名称 可查PID跟pgrep 差不多
[root@Nginx_BackUP keepalived]# pgrep nginx
3965
3966
3968