One linux Command every day (42): kill command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /210210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command Export (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxcommand every day (5): rm command Export (6): rmdir command http://www.bkjia.com/ OS /201210/164017. Html; one linux Command every day (7): mv command running (8): cp command http://www.bkjia.com/ OS /201210/163164.html#a linuxcommand every day (9): touch command running (10): cat command running (11 ): nl command http://www.bkjia.com/ OS /201211/165990.htmla linuxcommand every day (12): more command http://www.bkjia.com/ OS /201211/165994.htmllinuxcommand every day (13): Less command restart (14): head command http://www.bkjia.com/ OS /201211/166191.htmllinuxcommand every day (15): tail command restart (16): which command restart (17): whereis command restart (18 ): locate command http://www.bkjia.com/ OS /201211/168895.htmla linuxcommand every day (19): find command overview h Ttp: // timeout (20): exechttp of the find command: // www.bkjia.com/ OS /201211/168901.htmllinuxcommand every day (21): xargshttp of the find command: // timeout (22 ): detailed description of the parameters of the find command: http://www.bkjia.com/ OS /201211/168912.htmla linuxcommand every day (23): Linux directory structure (24): Linux file type and extension (2 5): linux File Attribute explanation example (26): Use SecureCRT to upload and download files. Example (27): linux chmod command example (28): tar command http://www.bkjia.com/ OS /201212/172.161.html A linuxcommand every day (29 ): chgrp command http://www.bkjia.com/ OS /201212/172983.htmla linuxcommand every day (30): chown command http://www.bkjia.com/ OS /201212/173239.htmlone per day Linux Command (31):/etc/group file detailed explanation http://www.bkjia.com/ OS /201212/174429.htmlevery day a linuxcommand (32): gzip command running (33): df command running (34): du command running (35 ): ln command http://www.bkjia.com/ OS /201212/174993.htmla linuxlinuxcommand every day (36): diff command http://www.bkjia.com/ OS /201212/176333.htmllinuxcommand every day (37): da Te command serial (38): cal command http://www.bkjia.com/ OS /201212/176337.htmllinuxcommand (39): grep command serial (40): wc command serial (41 ): the kill command in the http://www.bkjia.com/ OS /201212/177665.html Linux is used to terminate the running of the specified process (terminate a process), is a common command of process management in Linux. Generally, you can use Ctrl + C to terminate a foreground process. However, for a background process, you must use the kill command to terminate it, we need to first use ps/pidof/pstree/top and other tools to obtain the process PID, and then use the kill command to kill the process. The kill command ends a process by sending a specified signal to the process. By default, the TERM signal numbered 15 is used. The TERM signal terminates all processes that cannot capture the signal. For processes that can capture this signal, use the kill signal numbered 9 to forcibly "kill" the process. Www.2cto.com 1. Command Format: kill [parameter] [process number] 2. Command function: Send the specified signal to the corresponding process. If no model is specified, SIGTERM (15) is sent to terminate the specified process. If the program cannot be terminated and the "-KILL" parameter is available and the signal sent is SIGKILL (9), the process is forcibly terminated. You can run the ps command or the jobs command to view the process number. Root users will affect user processes. Non-root users can only affect their processes. 3. command Parameter:-l signal. If the serial number parameter is not added, the "-l" parameter will be used to list all the signal names-a when processing the current process, do not restrict the correspondence between command names and process numbers-p specify the kill command to print only the process numbers of the relevant process, without sending any signal-s specify the sending signal-u specify the user's attention: 1. The kill command can contain the signal number option or not. If there is no signal number, the kill command will send a termination signal (15), which can be captured by the process so that the process can clear and release resources before exiting. You can also use kill to send specific signals to the process. For example, kill-2 123 is equivalent to pressing Ctrl + C when running a process with a PID of 123 on the foreground. However, common users can only use the kill command without the signal parameter or use a maximum of-9 signals. 2. kill can contain a process ID as a parameter. When sending signals to these processes with kill, they must be the masters of these processes. If you try to undo a process without permission or undo a non-existent process, you will get an error message. 3. You can send signals to or terminate multiple processes. 4. After kill successfully sends a signal, the shell will display the process termination information on the screen. Sometimes this information is not immediately displayed. It is only displayed when the shell command prompt appears again by pressing Enter. 5. It should be noted that the process is forcibly terminated by a signal, which often brings some side effects, such as data loss or the terminal cannot be restored to normal. When sending a signal, you must be careful. Only when you have to do so can you use the kill signal (9), because the process cannot capture it first. To cancel all background jobs, enter kill 0. Some commands run in the background will start multiple processes, and it is very troublesome to trace and find the PID of all processes to be killed. Kill 0 is an effective method to terminate all processes started by the current shell. 4. use instance: instance 1: List all signal names command: kill-l output: [root @ localhost test6] # kill-l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR213) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGSTKFLT17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH29) SIGIO 30) SI GPWR 31) SIGSYS 34) SIGRTMIN35) SIGRTMIN + 1 36) SIGRTMIN + 2 37) SIGRTMIN + 3 38) SIGRTMIN + 439) SIGRTMIN + 5 40) SIGRTMIN + 6 41) SIGRTMIN + 7 42) SIGRTMIN + 843) SIGRTMIN + 9 44) SIGRTMIN + 10 45) SIGRTMIN + 11 46) SIGRTMIN + 1247) SIGRTMIN + 13 48) SIGRTMIN + 14 49) SIGRTMIN + 15 50) SIGRTMAX-1451) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-1055 56) SIGRTMAX-9 57) SIGRTMAX-8 58) SIGRTMAX-7 SIG RTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-263 64) SIGRTMAX Description: only 9th kinds of signal (SIGKILL) can unconditionally terminate the process, other signal process has the right to ignore. Below are common signals: HUP 1 terminal disconnection INT 2 interrupt (same as Ctrl + C) QUIT 3 QUIT (same as Ctrl + \) TERM 15 terminate KILL 9 Force terminate CONT 18 continue (opposite to STOP, fg/bg command) STOP 19 pause (same as Ctrl + Z) instance 2: Get the value command for the specified signal: output: [root @ localhost test6] # kill-l KILL9 [root @ localhost test6] # kill-l SIGKILL9 [root @ localhost test6] # kill-l TERM15 [root @ localhost test6] # kill-l SIGTERM15 [root @ localhost test6] # description: instance 3: first use ps to find the process, and then use kill to kill the command: kill 3268 output: [root @ localhost test6] # ps-ef | Grep vim root 3268 2884 0 00:00:00 pts/1 vim install. logroot 3370 2822 0 00:00:00 pts/0 grep vim [root @ localhost test6] # kill 3268 [root @ localhost test6] # kill 3268-bash: kill: (3268) -No process [root @ localhost test6] # Note: instance 4: kill-9 3268 command output: [root @ localhost test6] # ps-ef | grep vim root 3268 2884 0 00:00:00 pts/1 vim install. logroot 3370 2822 0 00:00:00 pts/0 grep vim [r Oot @ localhost test6] # kill-9 3268 [root @ localhost test6] # kill 3268-bash: kill: (3268)-No process [root @ localhost test6] # description: instance 5: Command for killing all processes of a specified user: kill-9 $ (ps-ef | grep peidalinux) kill-u peidalinux output: [root @ localhost ~] # Kill-9 $ (ps-ef | grep peidalinux) [root @ localhost ~] # Kill-u peidalinux Description: Method 1: filter out hnlinux user processes and kill instances. 6: The init process is a kill-9 command. Output: [root @ localhost ~] # Ps-ef | grep initroot 1 0 0 Nov02? 00:00:00 init [3] root 17563 17534 0 00:00:00 pts/1 grep init [root @ localhost ~] # Kill-9 1 [root @ localhost ~] # Kill-HUP 1 [root @ localhost ~] # Ps-ef | grep initroot 1 0 0 Nov02? 00:00:00 init [3] root 17565 17534 0 00:00:00 pts/1 grep init [root @ localhost ~] # Kill-KILL 1 [root @ localhost ~] # Ps-ef | grep initroot 1 0 0 Nov02? 00:00:00 init [3] root 17567 17534 0 00:00:00 pts/1 grep init [root @ localhost ~] # Note: init is an indispensable program in Linux system operations. The init process is a user-level process started by the kernel. After the kernel is started by itself (it has been loaded into the memory, started to run, and initialized to all the device drivers and data structures), it starts a user-level program init, complete the boot process. Therefore, init is always the first process (its process number is always 1 ). All other processes are descendants of the init process. The init process cannot be killed!