Article Title: describes how to kill a process in a Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In today's society, computers are becoming more and more popular. We use computers, but do we know how computers work? An operating system is essential to a computer. However, the Linux operating system has developed very rapidly and is catching up with Microsoft. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. Today I will explain how to kill processes in Linux. I hope you will remember how to explain how to kill processes in Linux. After collecting and sorting out the relevant Linux operating system killing process materials, I would like to recommend this article to you here, I hope you will have a lot of GAINS.
1. kill
Purpose: kill a process based on the process number.
Usage: kill [signal code] process ID
Example:
[Root @ localhost ~] # Ps auxf | grep httpd
Note: kill-9 to force termination and exit
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 SIGSTOP (17,19, 23) to stop a process, instead of killing the process in Linux.
Kill-CONT [pid]
Send SIGCONT (, 25) to start a stopped process again.
Kill-KILL [pid]
Send SIGKILL (9) to force the process to stop immediately without cleaning.
Kill-9-1
Terminate all processes you have.
2. killall
Purpose: directly kill all processes by program name
Usage: name of the program that is running killall
Example:
[Root @ localhost beinan] # pgrep-l gaim 2979 gaim
[Root @ localhost beinan] # killall gaim
Note: This command can use the-9 parameter to force the process to be killed.
3. pkill
Purpose: directly kill all processes by program name
Usage: # Name of the running program
Example:
[Root @ localhost beinan] # pgrep-l gaim 2979 gaim
[Root @ localhost beinan] # pkill gaim
[1] [2] Next page