kill,killall,pkill,top
kill,killall,pkill:都能发送信号。
kill 只能接进程号
killall 能接进程名称
pkill 可以删除某个终端,或者某个用户的进程
pkill -t pst/2
pkill -9 -t pst/2
pkill -u test01
pkill -19 -u test01
给进程发送信号
[root@localhost ~]# kill -l //列出所有支持的信号
编号 信号名
- SIGHUP 重新加载配置,信号发出之后,主进程的进程号不会发生变化,子进程进程号会发生变化。
[root@ds2 conf.d]# ps -ef |grep nginx
root 27618 1 0 18:16 ? 00:00:00 nginx: master process /opt/data/nginx/sbin/nginx -c /opt/data/nginx/conf/nginx.conf
nginx 27619 27618 0 18:16 ? 00:00:00 nginx: worker process
root 27754 18508 0 19:26 pts/1 00:00:00 grep --color=auto nginx
[root@ds2 conf.d]# kill -1 27618
[root@ds2 conf.d]# ps -ef |grep nginx
root 27618 1 0 18:16 ? 00:00:00 nginx: master process /opt/data/nginx/sbin/nginx -c /opt/data/nginx/conf/nginx.conf
nginx 27