- kill
作用:根据进程号杀死进程
用法: kill [信号代码] 进程ID
root@fcola:/# ps -ef | grep sendmail
smmsp 14354 14337 0 00:08 pts/1 00:00:00 sendmail start
smmsp 14356 3154 0 00:08 pts/0 00:00:00 sendmail -s
smmsp 14359 3154 0 00:09 pts/0 00:00:00 sendmail start
smmsp 14360 14337 0 00:09 pts/1 00:00:00 sendmail state
root 17723 15753 0 01:08 pts/2 00:00:00 vim sendmail.mc
root 19022 1 0 01:26 ? 00:00:03 gedit /etc/mail/sendmail.mc
root 20674 15753 0 01:55 pts/2 00:00:00 grep sendmail
root@loris-desktop:/# kill -9 14354
注意:kill -9 来强制终止退出
特殊用法:
kill -STOP [pid]
发送SIGSTOP (17,19,23)停止一个进程,而并不消灭这个进程。
kill -CONT [pid]
发送SIGCONT (19,18,25)重新开始一个停止的进程。
kill -KILL [pid]
发送SIGKILL (9)强迫进程立即停止,并且不实施清理操作。
kill -9 -1
终止你拥有的全部进程。
- killall
作用:通过程序的名字,直接杀死所有进程
用法: