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的 ...
随机推荐
- php Redis函数使用总结(string,hash,list, set , sort set )
对于:string, set , sort set , hash 的增,改操作,是同一个命令,但是把它当改操作时,及时成功返回值依旧为0 对于:list结构来说,增删改查自有一套方法. <? ...
- 关于Unity中NGUI图片精灵响应鼠标的方法
我在Unity里做NGUI的时候发现一个问题. 在Unity2D场景当中,一个精灵图片只要加上了Box Collider或者Box Collider2D,就可以相应OnMouseEnter和OnMou ...
- pymysql实现从a表过滤出有效信息添加至b表
# Author: yeshengbao # -- coding: utf-8 -- # @Time : 2018/4/16 19:23 import pymysql # 创建连接 conn = py ...
- [HNOI 2008]GT考试
Description 题库链接 问你长度为 \(n\) 的可含前导零的数字串中,不含长度为 \(m\) 的子串 \(X\) 有多少个,取模. \(1\leq n\leq 10^9,1\leq m\l ...
- [TJOI 2017]可乐
Description 加里敦星球的人们特别喜欢喝可乐.因而,他们的敌对星球研发出了一个可乐机器人,并且放在了加里敦星球的1号城市上.这个可乐机器人有三种行为: 停在原地,去下一个相邻的城市,自爆.它 ...
- bzoj 2339: [HNOI2011]卡农
Description Solution 比较难想.... 我们先考虑去掉无序的这个条件,改为有序,最后除 \(m!\) 即可 设 \(f[i]\) 表示前\(i\)个合法集合的方案数 明确一点: 如 ...
- bzoj4946 Noi2017 蔬菜
题目描述 小 N 是蔬菜仓库的管理员,负责设计蔬菜的销售方案. 在蔬菜仓库中,共存放有nn 种蔬菜,小NN 需要根据不同蔬菜的特性,综合考虑各方面因素,设计合理的销售方案,以获得最多的收益. 在计算销 ...
- ●BZOJ 4361 isn
题链: http://www.lydsy.com/JudgeOnline/problem.php?id=4361 题解: 容斥,DP,树状数组 注意题意:一旦变成了非降序列,就停止操作.即对非降序列进 ...
- hdu4605 树状数组+离散化+dfs
Magic Ball Game Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- [Noi2016]网格
来自FallDream的博客,未经允许,请勿转载,谢谢. 跳蚤国王和蛐蛐国王在玩一个游戏. 他们在一个 n 行 m 列的网格上排兵布阵.其中的 c 个格子中 (0≤c≤nm),每个格子有一只蛐蛐, ...