"Linux learning is not difficult" process management (4): Kill process kills command

Source: Internet
Author: User

20.4 "Linux learning is not difficult" process management (4): Kill process kills Command

To close an application can be done by killing its process, and if the process cannot be killed at the moment, it can be forced to kill.

Use the KILL command to kill a process. Before using the KILL command, you need to get the PID (process number) of the process to be killed. The user can use the PS command to get the PID of the process and then use the PID of the process as the parameter of the KILL command. When the KILL command is used, the user will not get any feedback even if the job is completed on schedule. The only way to determine if a process is terminated is to use the PS command to see if the PID number or process name of the process still exists.

Kill with no options will close the open file, and if this does not work, use the-9 option when using the KILL command, which will unconditionally kill a process. The disadvantage of this approach is the process of forcing the job to abort before the job is completed. If you use "kill-9" for a program that is updating a file, the user may lose the updated material or the entire file. In most cases, the KILL command without an option can terminate most processes.

Another use of the KILL command is to send a signal to the specified process or process group, or to determine whether the process that specifies the process number still exists. Sends a signal to the specified process, and if the process does not capture the signal, the process terminates.

Command syntax:

Kill [Options] [process number]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-S < signals >

specify the signal to send

-L

display a list of signal names , altogether a

Example: forcing a process with process number 1659 to be killed.

[Email protected] ~]# kill-9 1659


This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .


"Linux learning is not difficult" process management (4): Kill process kills command

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.