Linux Kill command parameters and usage detailed

Source: Internet
Author: User

Linux kill command with detailed

Function Description: Deletes the program or work in execution.

Syntax: Kill [s < info name or number >][program] or kill [-l < information number]

Supplemental Note: Kill can 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, use Sigkill (9) information to try to force the deletion program. The program or work number can be viewed using either the PS directive or the jobs command.

Parameters

-L < information number > without < information number > option, the-l parameter lists all the information names.

-S < information name or number > Specifies the information to be sent.

Program [Program] can be a program's PID or Pgid, or it can be a work number.

The KILL command can get a general idea of what it's doing from the word kill, and yes, it's used to Kill (kill) a process. Below is a detailed explanation of the kill command.

1. Role

The KILL command is used to abort a process.

2. Format

Kill [S Signal |-P] [-a] pid ...

Kill-l [Signal]

3. Parameter

-S: Specifies the signal to send.

-P: Analog send signal.

-L: Specifies the name list of the signal.

PID: The ID number of the process to abort.

Signal: Indicates a signal.

4. Notes

Processes are a very important concept in Linux systems. Linux is a multitasking operating system that often runs multiple processes at the same time. We don't care how these processes are allocated, or how the kernel manages the allocation of time slices, and how they are concerned with controlling these processes so that they can serve users well.

The Linux operating system consists of three different types of processes, each with its own characteristics and attributes. The interaction process is a process initiated by a shell. The interaction process can be run either in the foreground or in the background. The batch process is not connected to the terminal and is a sequence of processes. The monitoring process (also known as the System daemon) is the process that starts when the Linux system starts and runs in the background. For example, HTTPD is the well-known Apache server monitoring process.

The KILL command works by sending a system action signal to the kernel of the Linux system and a process identification number for a program, and the system kernel can then operate on the process specified by the process identification number. For example, in the top command, we see that the system runs many processes, and sometimes it is necessary to abort certain processes using kill to improve system resources. When explaining the installation and landing commands, it was mentioned that the function of multiple virtual consoles of a system is to switch to other virtual consoles to work off the program when a program fails to cause the system to deadlock. The command used at this point is kill, because Kill is a direct call to most shell internal commands.

application Example One:

(1) forcibly terminated (often used to kill) a process with a process identification number of 324:

#kill-9 324

(2) Unlock the Linux system deadlock

In Linux, there are times when a program crashes and is in a deadlock state. You don't have to restart your computer at this time, just abort (or close) the problematic program. When the Kill is in the X-window interface, the main program (except the crashed program) is normally activated. A terminal is opened at this time, where the problematic program is stopped. For example, if the Mozilla browser program is deadlocked, you can use the KILL command to abort all programs that contain Mozolla browsers. First use the top command to investigate the program's PID, and then use the KILL command to stop this program:

#kill-sigkill XXX

where xxx is the process identification number of the program that contains the Mozolla browser.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.