kill, killall, pkill, xkill
1. Kill Command – Kill the process by specifying its PID
All the below kill conventions will send the TERM signal to the specified process. For the signals, either the signal name or signal number can be used. You need to lookup the pid for the process and give it as an argument to kill.
$ kill -TERM pid $ kill -SIGTERM pid $ kill -15 pid
Example: Kill the firefox process.
$ ps -ef | grep firefox
1986 ? Sl 7:22 /usr/lib/firefox-3.5.3/firefox $ kill -9 1986
2. Killall Command – Kill processes by name
Instead of specifying a process by its PID, you can specify the name of the process. If more than one process runs with that name, all of them will be killed.
Example: Kill all the firefox processes
$ killall -9 firefox
3. Pkill Command – Send signal to the process based on its name
You can send signal to any process by specifying the full name or partial name. So there is no need for you to find out the PID of the process to send the signal.
Example: Send SIGTERM to all the process which has sample in its name.
$ pkill sample
Pkill Example:
Before sending signal, you can verify which are all the process is matching the criteria using “pgrep -l”, which displays the process ID and process name of the matching processes.
In this example, all the processes are designed to log the signal to signal-log, along with its PID.
$ pgrep -l sample
12406 sample-server.p
12425 sample-server.p
12430 sample-garbagec $ pkill -USR1 sample $ cat signal-log
Name: ./sample-server.pl Pid: 12406 Signal Received: USR1
Name: ./sample-server.pl Pid: 12425 Signal Received: USR1
Name: ./sample-garbagecollector.pl Pid: 12430 Signal Received: USR1
Note: The part of name which you specify should be in the character within the first 15 character of the process name.
4. Xkill Command – kill a client by X resource
xkill is the simplest way to kill a malfunctioning program. When you want to kill a process, initiate xkill which will offer an cross-hair cursor. Click on the window with left cursor which will kill that process.
$ xkill
Select the window whose client you wish to kill with button 1....
xkill: killing creator of resource 0x1200003
Note: Actually, xkill instructs XServer to terminate the client.
kill, killall, pkill, xkill的更多相关文章
- Linux终止进程的工具kill/killall/pkill/xkill/skill用法区别(转)
一. 终止进程的工具kill .killall.pkill.xkill 终止一个进程或终止一个正在运行的程序,一般是通过kill .killall.pkill.xkill等进行.比如一个程序已经死掉, ...
- 9.4-6 kill & killall & pkill
kill:终止进程 能够终止你希望停止的进程. kill 命令的参数选项及说明 -l 列出全部的信号名称 -p 指定kill命令只打印相关进程的进程号,而不发送任何信号 -s 指定要 ...
- Linux命令——killall 、kill 、pkill、xkill
参考:killall .kill .pkill 命令详解 Using kill, killall, and pkill 4 Ways to Kill a Process – kill, killall ...
- Sending Signals to Processes with kill, killall, and pkill
The Linux kernel allows many signals to be sent to processes. Use man 7 signals for a complete overv ...
- Linux之kill,pkill,killall命令
kill,pkill,killall这些命令都是用来杀死进程的 查找进程的方法: ps -ef|grep pidof 进程名 ps命令 http://www.cnblogs.com/along1226 ...
- killall 、kill 、pkill 命令详解
killall 命令 Linux系统中的killall命令用于杀死指定名字的进程(kill processes by name).我们可以使用kill命令杀死指定进程PID的进程,如果要找到我们需要杀 ...
- killall 、kill 、pkill 命令详解 【转】
之前常用地kill 命令就是 kill -9 XXid;kill -15 XXid;pkill 进程名: 今天发现killall也有适用场景,killall命令对杀死进程组(一个进程中有多线程的情况) ...
- killall 、kill 、pkill 命令区别
转至:https://zhuanlan.zhihu.com/p/87904563 killall 命令 Linux系统中的killall命令用于杀死指定名字的进程(kill processes by ...
- Linux中kill,pkill,killall和xkill命令汇总讲解
终止一个进程或终止一个正在运行的程式,一般是通过 kill .killall.pkill.xkill 等进行.比如一个程式已死掉,但又不能退出,这时就应该考虑应用这些工具. 另 外应用的场合就是在服务 ...
随机推荐
- 慕课笔记-Java入门第二季
1.java对象的使用 (1)创建对象 类名 对象名=new 类名(); (2)使用对象 引用对象的属性:对象名.属性; 引用对象的方法:对象名.方法(); Note: ①Java会给成员变量赋初始值 ...
- C# 基础之密封类
C#密封类 一.密封类 1. 密封类的定义 如果我们不希望自己编写的类被继承:如果有的类已经没有再被继承的必要,这时,我们可以使用sealed修饰符在类中进行声明,以达到该类不能派生其它类的目的,该类 ...
- Codeforces 1114E(简单交互)
这里有一道老实题,大家快来踩爆它! 交互题:根据你的输出决定下一次的输入. 请听题: 管理员有个乱序数列(举例:{14, 24, 9, 19}),排序以后是个等差数列({9, 14, 19, 24}) ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A
Description There are literally dozens of snooker competitions held each year, and team Jinotega tri ...
- [已读]CSS禅意花园
蛮早的一本书,提到了一些小tip,比如负margin实现居中.FIR图像替换.
- 配置Gradle构建
构建基础配置 Android Studio包含一个顶级的构建文件和每个模块的构建文件.构建文件被称为 build.gradle,它是一个纯文本文件,它使用Groovy语法来配置由Android Gra ...
- Storm编程入门API系列之Storm的Topology多个Executors数目控制实现
前期博客 Storm编程入门API系列之Storm的Topology默认Workers.默认executors和默认tasks数目 Storm编程入门API系列之Storm的Topology多个Wor ...
- C# readonly和const的区别
什么是静态常量(Const)和动态常量(Readonly) 先解释下什么是静态常量(Const)以及什么是动态常量(Readonly). 静态常量(Const)是指编译器在编译时候会对常量进行解析,并 ...
- android开发学习 ------- 【转】 android中的线程池
线程很常见 , https://blog.csdn.net/seu_calvin/article/details/52415337 参考,保证能看懂.
- javaScript面向对像
1.创建对象 <script type="text/javascript"> function Flower(name,addre) { this.name=name; ...