Linux杀死进程的方法

来源:互联网 发布:联想售后系统优化 编辑:程序博客网 时间:2024/05/17 17:46

查看进程状态:

命令:

ps -ef;

ps -aux;

ps -ef | grep (进程名):只查看指定进程名进程的状态

pgrep (进程名):查看指定进程名进程状态

pkill -9 (进程名):杀死指定进程名进程

kill -s 9 (进程号):-s 9 制定了传递给进程的信号是9,即强制、尽快终止进程。

killall -9 (进程名):杀死指定进程名进程。(如果给出的进程名不完整,killall会报错。pkill或者pgrep只要给出进程名的一部分就可以终止进程)


各种信号及其用途:

SignalDescriptionSignal number on Linux x86[1]SIGABRTProcess aborted6SIGALRMSignal raised by alarm14SIGBUSBus error: "access to undefined portion of memory object"7SIGCHLDChild process terminated, stopped (or continued*)17SIGCONTContinue if stopped18SIGFPEFloating point exception: "erroneous arithmetic operation"8SIGHUPHangup1SIGILLIllegal instruction4SIGINTInterrupt2SIGKILLKill (terminate immediately)9SIGPIPEWrite to pipe with no one reading13SIGQUITQuit and dump core3SIGSEGVSegmentation violation11SIGSTOPStop executing temporarily19SIGTERMTermination (request to terminate)15SIGTSTPTerminal stop signal20SIGTTINBackground process attempting to read from tty ("in")21SIGTTOUBackground process attempting to write to tty ("out")22SIGUSR1User-defined 110SIGUSR2User-defined 212SIGPOLLPollable event29SIGPROFProfiling timer expired27SIGSYSBad syscall31SIGTRAPTrace/breakpoint trap5SIGURGUrgent data available on socket23SIGVTALRMSignal raised by timer counting virtual time: "virtual timer expired"26SIGXCPUCPU time limit exceeded24SIGXFSZFile size limit exceeded25参考:http://blog.csdn.net/andy572633/article/details/7211546

0 0