The KILL command in Linux

Source: Internet
Author: User

I. Definition

the kill command is used to remove a program or work from execution. Kill to send the specified information to the program. The preset information is sigterm (15), which terminates the specified program. If you still cannot terminate the program, you can use the Sigkill (9) information to try to force the removal of the program. The program or work number can be viewed using the PS or job command

two. Syntax
Kill Options Parameters
Options
-A: When the current process is processed, the correspondence between the command name and the process number is not restricted;-L < information number;: If no < information number > option, the-l parameter lists all information names;-p: Specify Kill The command prints only the process number of the relevant process without sending any signal;-s < information name or number >: Specify the information to send;-u: Specify the user.
Parameters
Process or job identification number: Specifies the process or job to delete
three. Examplekill-l List all signal names
Kill-L1) SIGHUP2) SIGINT3) Sigquit4) Sigill5) SIGTRAP6) SIGABRT7) Sigbus8) SIGFPE9) SIGKILLTen) SIGUSR1 One) SIGSEGV A) SIGUSR2 -) Sigpipe -) SIGALRM the) SIGTERM -) Sigstkflt -) SIGCHLD -) Sigcont +) SIGSTOP -) SIGTSTP +) Sigttin A) Sigttou at) Sigurg -) Sigxcpu -) Sigxfsz -) SIGVTALRM -) sigprof -) Sigwinch in) SIGIO -) SIGPWR to) Sigsys the) Sigrtmin *) sigrtmin+1   $) sigrtmin+2  Panax Notoginseng) sigrtmin+3   -) sigrtmin+4 the) sigrtmin+5   +) sigrtmin+6   A) sigrtmin+7   the) sigrtmin+8 +) sigrtmin+9   -) sigrtmin+Ten  $) sigrtmin+ One  $) sigrtmin+ A -) sigrtmin+ -  -) sigrtmin+ -  the) sigrtmin+ the  -) sigrtmax- -Wuyi) sigrtmax- -  the) sigrtmax- A  -) sigrtmax- One  Wu) sigrtmax-Ten -) sigrtmax-9   About) sigrtmax-8   $) sigrtmax-7   -) sigrtmax-6 -) sigrtmax-5   -) sigrtmax-4   A) sigrtmax-3   +) sigrtmax-2 the) sigrtmax-1   -) Sigrtmax
the usual signals

Only the 9th signal (SIGKILL) can terminate the process unconditionally, other signal processes have the right to ignore

HUP     1     terminal disconnection int     2    interrupt (with Ctrl + C) quit    3    exit (same as Ctrl + \)   term     end Kill    9     Force termination cont        (in contrast to stop, fg/BG command)   stopis    paused (with Ctrl + Z)
force the Tomcat process to be killed

First use PS-EF to find the process ID (PID) of Tomcat, and then use the kill-9 process number, force termination

Ps-ef | grep TomcatRoot12280     1  0Aug05?xx: .: -/usr/local/jdk1.8.0_65/bin/java-djava.util.logging.config.file=/usr/local/apache-tomcat-6.0.Panax Notoginseng/conf/logging.properties-djava.util.logging.manager=org.apache.juli.classloaderlogmanager-djava.endorsed.dirs= /usr/local/apache-tomcat-6.0.Panax Notoginseng/endorsed-classpath/usr/local/apache-tomcat-6.0.Panax Notoginseng/bin/bootstrap.jar-dcatalina.base=/usr/local/apache-tomcat-6.0.Panax Notoginseng-dcatalina.home=/usr/local/apache-tomcat-6.0.Panax Notoginseng-djava.io.tmpdir=/usr/local/apache-tomcat-6.0.Panax Notoginseng/temp Org.apache.catalina.startup.Bootstrap startroot17096 17008  0  at: -pts/0    xx:xx:xx grepTomcatkill-9 12280Kill-9 12280-bash:Kill: (12280)-No Such process

Reference Articles

Http://man.linuxde.net/kill

The KILL command in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.