Kill: Kill the process
Role: Kill command to terminate a process.
Usage: Kill [-S Signal |-p] [-A] PID...
Or kill-L [Signal]
The main options are as follows:
--S: Specifies the sent signal.
--P: analog transmission signal.
--L: Specifies the signal name list.
-Pid: ID of the process to be terminated.
-Signal: indicates the signal.
Note: Kill can send specified information to the program. The preset information is sigterm (15). You can terminate the specified program. If you still cannot terminate the program, you can use sigkill (9) Information to try to forcibly Delete the program. The kill command works by sending a system operation signal and a program process flag number to the Linux kernel. Then, the system kernel can operate the process specified by the process flag number. When a foreground process needs to be interrupted, the CTRL + C key combination is usually used. However, a background process cannot be solved by a key combination. In this case, the kill command must be used.
The application example is as follows.
(1) If an error occurs during command execution, you can use "kill" to end the task.
For processes running in the background, you can use the kill command to terminate:
# Du-A/| sort-Rn>/tmp/du. Sorted &
[1] 237
# Killed 237
Or run the following command:
# Du-A/| sort-Rn>/tmp/du. Sorted &
[1] 237
# Kill % 1
(2) For zombie processes, kill-9 can be used to force termination and exit.
For example, if a program has completely died and kill cannot exit without signal strength, the best way is to add signal strength-9, followed by killing the parent process.
For example:
# Ps aux | grep Gaim
Beinan 5031 9.0 2.3 104996 17484? S Gaim
Root 5036 0.0 0.0 5160 724 pts/3 S + grep Gaim
The kill command family members are described as follows.
Terminate a process or terminate a running program. Generally, kill, killall, pkill, and xkill are used. For example, if a program is dead but cannot exit, you should consider using these tools. Killall directly kills all processes by program name. Pkill is similar to killall's application method. It also directly kills running programs. If you want to kill a single process, kill it. Xkill is a program used on the desktop to kill the graphic interface. For example, when Firefox crashes and cannot exit, you can click the mouse to kill Firefox. When xkill runs the time mark, a personal brain icon is displayed. If any graphics program crashes, it will be okay. To terminate xkill, right-click to cancel.
Title: Fast query of Linux core application commands
Author: Cao jianghua,Edited by Fang Jianguo
ISBN: 978-7-121-11149-5
Publication date: 2010Year7Month
Pricing:59.00RMB
Start: 16Open
Page number: 528Page
Internal Capacity Simplified Introduction
After more than a decade of development, the Linux operating system has been continuously improved and more applications have been made. Now, Linux Desktop is relatively mature, but the command line technology is still the core technology of Linux.
This book introduces the functions, syntaxes, options, typical application instances, and precautions of core management commands (including the latest virtualization management commands and SELinux management commands) under Linux Command lines, every command is described in detail and a large number of instances are described. This gives readers a quick and in-depth understanding of commands in Linux. The book is classified according to the functions of Linux commands for readers to query. Before reading this book, you do not need to have too much background knowledge, whether you are a Unix user, a new linux user, or even a Windows user who has never been in touch with Linux, you can easily understand and master the content, and quickly understand and use the Linux system of each release. This book uses the commands involved in RHEL 5.5 and also applies to other Linux distributions. It is a required reference for all Linux users.
Related serialization:
Linux core application command quick query serialized eight: BG: Running commands in the background
Linux core application command quick query serialization 6: Batch: execute commands when the system load level permits
Linux core application command quick query: ATQ: displays the command queues to be executed after the AT command is used.
Linux core application command quick query: at: scheduled Run Command
Linux core application command quick query: SA: Reports, cleans up, and maintains process statistical files
Linux core application command quick query serialization 2: lastcomm: displays information about previously used commands
Linux core command speed query: accton: Process statistics on enabling or disabling