In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "the method of killing process under linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Kill
Function: kill the process according to the process number
Usage: kill [signal code] process ID
For example:
[root@localhost ~] # ps auxf | grep httpd
Note: kill-9 to force termination of exit
For example, [root@localhost ~] # ps aux | grep gaim
Or [root@localhost ~] # pgrep-l gaim 5031 gaim
5031 gaim
[root@localhost] # kill-9 5031
Special usage:
Kill-STOP [pid]
Send SIGS***7,19,23) stops a process without linux killing the process.
Kill-CONT [pid]
Send SIGCONT (19, 18, 25) to restart a stopped process.
Kill-KILL [pid]
Sending a SIGKILL (9) forces the process to stop immediately and does not perform a cleanup operation.
Kill-9-1
Terminate all processes you have.
2. Killall
Function: kill all processes directly through the name of the program
Usage: the name of the program that killall is running
For example:
[root@localhost beinan] # pgrep-l gaim 2979 gaim
[root@localhost beinan] # killall gaim
Note: this command can use the-9 parameter to forcibly kill the process.
3. Pkill
Function: kill all processes directly through the name of the program
Usage: # name of the program that pkill is running
For example:
[root@localhost beinan] # pgrep-l gaim 2979 gaim
[root@localhost beinan] # pkill gaim
4. Xkill
Purpose: a program that kills the desktop graphical interface.
Example of an application scenario: when firefox crashes and cannot exit, you can kill firefox with a mouse click.
When the xkill runtime comes out and the personal brain bone icon, which graphics program crashes a little bit will OK.
If you want to terminate xkill, right click to cancel
Call method:
[root@localhost ~] # xkill
◆ Note:
KILLALL
NAME (name)
Killall-linux the kill process by name
SYNOPSIS (Overview)
Killall [- egiqvw] [- signal] name...
Killall-l
Killall-V
DESCRIPTION (description)
Killall sends a signal to all processes that run any given command. If no signal name is specified, SIGTERM.
The signal can be specified by name (such as-HUP) or number (such as-1). Signal 0 (check whether a process exists) can only be specified digitally.
If the command name includes a slash (/), 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, killall returns a non-zero value. If at least one process is killed for each command, killall returns 0. The Killall process will never kill itself (but it can kill other killall processes).
OPTIONS (option)
-e for very long names, exact matching is required. If a command name is longer than 15 characters, you may not be able to use the entire name (overflow). In this case, killall kills all processes that match the first 15 characters of the name. With the-e option, such records will be ignored. If the-v option is also specified, killall prints a message for each ignored record.
-g kills processes that belong to this process group. Kill signals are sent only once to each group, even if there are multiple processes in the same process group.
-I interactive way to solicit confirmation information before linux kills the process.
-l lists all known signal names.
-Q if there is no process to kill, no complaint will be made.
-v reports whether the signal was sent successfully.
-V displays version information.
-W wait for all the killing processes to die. Killall checks every second to see if any killed processes still exist and returns only when they are dead. Note: if the signal is ignored or does not work, or if the process stays in a zombie state, the killall may wait.
FILES (related documents)
The location where the / proc proc file system exists.
KNOWN bugS (known BUGS)
Killing as a file only works on executables that have been open during execution, that is, mixed executables cannot be killed in this way.
A warning is that typing killall name may not have the desired effect on non-Linux systems, especially when privileged users execute with caution.
Between scans, if the process disappears and is replaced by a new process with the same PID, killall-w cannot detect it.
This is the end of the content of "how to kill the process under linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 237
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.