"Go" Linux kill process

Source: Internet
Author: User

After the collection and collation of the relevant Linux operating system to kill the process of material, here to recommend this article, I hope you will see a lot of harvest.

1. Kill

Role: Kill process based on process number

Usage: Kill [signal code] process ID

Example:

1.[[email protected] ~]# PS auxf |grep httpd

Note: kill-9 to force termination of exit

Example

1.[[email protected] ~]# PS aux |grep gaim

Or

1.[[email protected] ~]# pgrep-l gaim 5031 Gaim

2.5031 Gaim

3.[[email protected] ~]# kill-9 5031

Special usage:

1.kill-stop [PID]

Send Sigstop (17,19,23) to stop a process and not the Linux operating system to kill the process.

1.kill-cont [PID]

Send Sigcont (19,18,25) to restart a stopped process.

1.kill-kill [PID]

Send Sigkill (9) forces the process to stop immediately and does not implement a cleanup operation.

1.kill-9-1

Stop all the processes you have.

2. Killall

Function: Kill all processes directly by the name of the program

Usage: Killall The program name that is running

Example:

1.[[email protected] beinan]# pgrep-l gaim 2979 Gaim

2.[[email protected] beinan]# killall Gaim

Note: This command can use the-9 parameter to force the kill process

3. Pkill

Function: Kill all processes directly by the name of the program

Usage: #pkill The program name that is running

Example:

1.[[email protected] beinan]# pgrep-l gaim 2979 Gaim

2.[[email protected] beinan]# pkill Gaim

4. Xkill

Role: The program that kills the desktop graphical interface.

Application Case Example: Firefox crashes can not exit, click the mouse will be able to kill Firefox.

When the Xkill runs out and the individual brain bone icon, which graphics program crashes a little is OK.

If you want to terminate the Xkill, press the right button to cancel;

Call Method:

1.[[email protected] ~]# Xkill

Note

KILLALL

Name (title)

Killall-Name the Linux operating system to kill the process

Synopsis (Overview)

Killall [-EGIQVW] [-signal] name ...

Killall-l

Killall-v

DESCRIPTION (description)

Killall sends a signal to all processes that run any of the specified commands. If no signal name is specified, Sigterm is sent.

The signal can be specified in the form of a name (such as-hup) or a number (such as-1). Signal 0 (check whether the process exists) can only be specified numerically.

If the command name includes a slash (/), then the process executing that particular file will be killed, regardless of the process name.

If there is no process to kill for the listed command, then Killall returns a value other than 0. If at least one process has been killed for each command, Killall returns 0. The Killall process never kills itself (but can kill other Killall processes).

Options (optional)

-E for very long names, the exact match is required. If a command name is longer than 15 characters, the entire name may not be used (overflow). In this case, Killall kills all processes that match the first 15 characters of a name. With the-e option, such a record will be ignored. If you specify the-v option at the same time, killall prints a message for each ignored record.

-G kills processes that belong to the process group. The kill signal is sent to each group only once, even if the same process group contains multiple processes.

-I interactive mode, asking for confirmation before the Linux operating system kills the process.

-l lists all known signal names.

-Q If no process is killed, no complaints will be raised.

-V reports whether the signal was sent successfully.

-V Displays version information.

-W waits for all killed processes to die. The killall will check once per second if any of the killed processes are still present and only return if they are all dead. Note: If the signal is ignored or does not work, or the process stays in zombie state, killall may wait forever.

Files (related documents)

/proc the location of the proc file system.

Known BugS (known BugS)

Killing files is only useful for executables that have been opened at execution time, that is, mixed executables cannot be killed in this way.

The caveat is that the input killall name may not produce the expected effect on a non-Linux operating system, especially when privileged users are performing with caution.

In the gap of two scans, if the process disappears and is replaced by a new process with the same PID, killall-w is not detected.

"Go" Linux kill process

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.