How to kill a particular user terminal on Linux
Intro.
Sometimes, the application we launched from command promp failed to exit. What we require is terminating it without clicking the ‘X’ button in the top of the terminal window. In this case, we prefer the combination of w
and pkill
, read the flowing for details.
Display termial name
To kill the terminal process, we have to which terminal process we are going to kill! Apparently, w
is a simple command that could tell us who is doing what on the current Linux. An example is showing below.
$ w
14:14:26 up 5:28, 6 users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
abc pts/1 172.16.1.137 09:42 3:34m 4:56 4:55 vim a.c
aban pts/4 192.168.1.7 09:30 16:26 0.18s 0.18s -bash
aban pts/5 192.168.1.7 09:31 1:47m 4.21s 4.13s nmon
cust pts/6 172.16.0.133 12:48 1:22m 0.07s 0.07s -bash
aban pts/9 192.168.1.7 13:59 11:38 0.20s 0.11s vim b.c
aban pts/10 192.168.1.7 14:02 2.00s 0.05s 0.00s w
In the code above, we could easily find the TTY we intend to kill. For instance, pts/2 is the teriminal we want to kill. What we have to do next is :
pkill -kill -t pts/2
What did just happen after click enter key on our keyboard? Just execute w
again, you will not miss the answer!
Have a try and if you have any question, do not hesitate to add post below.
Good luck !
How to kill a particular user terminal on Linux的更多相关文章
- Process Kill Technology && Process Protection Against In Linux
目录 . 引言 . Kill Process By Kill Command && SIGNAL . Kill Process By Resource Limits . Kill Pr ...
- Linux进程自保护攻防对抗技术研究(Process Kill Technology && Process Protection Against In Linux)
0. 引言 0x1: Linux系统攻防思想 在linux下进行"进程kill"和"进程保护"的总体思路有以下几个,我们围绕这几个核心思想展开进行研究 . 直接 ...
- mac系统terminal连接linux
ssh user@hostname user是管理员账号 hostname是服务器ip
- 【转载】Linux kill, killall, kill -9
1) 查看进程的方法: ps -ef 或者 ps aux root 15087 0.0 0.0 0 0 ? S 23:31 0:00 [kwo ...
- 【Linux常用命令】Linux kill, killall, kill -9,
参考链接 https://blog.csdn.net/zong596568821xp/article/details/77899454 kill + PID kill -9 + PID 加上-9 是 ...
- kill命令
*杀死进程最安全的方法是单纯使用kill命令,不加修饰符,不带标志. 首先使用ps -ef命令确定要杀死进程的PID,然后输入以下命令: # kill -pid 注释:标准的kill命令通 ...
- CentOS 6.6 中设置Terminal快捷键
排版比较乱,参见 https://www.zybuluo.com/Jpz/note/144583 CentOS 6.6 中设置Terminal快捷键 Linux开发环境配置 Terminal是Cent ...
- 【Kill】两条Linux命令彻底杀死Oracle
今天编写的两条极具杀伤力的命令,它可以瞬间将Oracle杀死在无形之中.后面我将给出简单注释并展示一下它的威力.$ ps -ef |grep $ORACLE_SID|grep -v grep|awk ...
- kill 和killall----杀死进程
1.根据进程ip查看进程名 Liunx中 通过进程名查找进程PID可以通过 pidof [进程名] 来查找. 反过来 ,通过PID查找进程名则没有相关命令.但在linux根目录中,有一个/proc的 ...
随机推荐
- jquery ajax 发送邮件例子
<div class="form"> <dl> <dt>您的称呼<small>(必填)</small></dt&g ...
- Angular CLI 安装
安装Angular 官网的教程,因为国内网络环境原因,访问不了服务器,导致安装失败. 1.先安装NodeJs 安装教程:http://blog.csdn.net/zengmingen/article/ ...
- 【django之modelform】
一.什么是modelform ModelForm顾名思义就Form和Django的Model数据库模型结合体,可以简单.方便得对数据库进行增加.编辑操作和验证标签的生成: 举例说明: 比如我们的数据库 ...
- JavaScript 和 TypeScript 中的 class
对于一个前端开发者来说,很少用到 class ,因为在 JavaScript 中更多的是 函数式 编程,抬手就是一个 function,几乎不见 class 或 new 的踪影.所以 设计模式 也是大 ...
- mybatis学习三
Mybatis与pageHelper分页: 分页分为假分页和真分页对应的专业术语叫做逻辑分页和物理分页 逻辑分页:将所有的数据从数据库查询出来,根据需求截取符合要求的数据返回,方便统一但效 ...
- 关于wooyun-2015-096990的总结
漏洞url:http://wooyun.jozxing.cc/static/bugs/wooyun-2015-096990.html 摘要 if(!ini_get('register_globals' ...
- JS 变量类型互相转换
转载自:http://zhaizhiyuan.blog.163.com/blog/static/1897672632009093147268/ Java中几种常用的数据类型之间转换方法: 1. sh ...
- [HNOI2012]集合选数
题目描述 <集合论与图论>这门课程有一道作业题,要求同学们求出{1, 2, 3, 4, 5}的所有满足以 下条件的子集:若 x 在该子集中,则 2x 和 3x 不能在该子集中. 同学们不喜 ...
- [BZOJ]1045 糖果传递(HAOI2008)
放一道数学题. Description 有n个小朋友坐成一圈,每人有ai个糖果.每人只能给左右两人传递糖果.每人每次传递一个糖果代价为1. Input 第一行一个正整数n<=1000000,表示 ...
- MySQL插件实现浅析——插件的调用
一. MySQL中的动态插件 最初想到这个问题是在学习mysql半同步复制相关问题的时候,为何在mysql运行时install半同步插件并开启后就能起到作用,他是如何让事务停下来等待的.安装插件的时候 ...