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的 ...
随机推荐
- Collection集合框架详解
[Java的集合框架] 接口: collection map list set 实现类: ArryList HashSet HashMap LinkList LinkHash ...
- 关于python 使用腾讯云OCR 通用印刷体识别
腾讯的python SDK没有通用印刷体识别,所以参考了别人识别网上图片的方式:https://www.cnblogs.com/semishigure/p/7690789.html 但是咱们使用的基本 ...
- 三,前端---JS最基本的创建对象的方法
1:工厂模式 function createPerson(name, job){ var person = new Object(); person.name = name; person.job = ...
- 【PYTHON】用户登录三次错误锁定
黑名单:blacklist.txt 用户名单:username_password.py # Author:Stephen Yuan # 用户名和密码 username_password = { ', ...
- Opencv在mac系统的安装与试用
1.在mac终端内,使用brew安装opencv3,这时我的opencv被安装到/usr/local/Cellar/opencv3/3.2.0内. 2.新建xcode 项目,选择command lin ...
- Python学习【第26篇】:Python系列- 多线程(threading)
线程的调用方式:threanding模块 import threading import time def sayhi(num): #定义每个线程要运行的函数 print("running ...
- SpringIOC学习三
基于注解的注入:就是用注解标签的方式替换掉我们xml配置文件里面bean的注册和依赖关系的描述 a:首先回顾IOC(控制反转),进行依赖注入需要做到两件事情: 1:注册类 2:描 ...
- 想进大厂,想收获高薪offer,资深猎头告诉你怎么做......
其实吧,面试官面试的时候主要就看三个方面:现在能力如何,未来潜力如何,人品如何. 第一个因素是最重要的,因为后面两个因素有太多的人为判断因素,无法量化.所谓的面试准备,"现在能力如何&quo ...
- [HNOI 2010]Bounce 弹飞绵羊
Description 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏.游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置 ...
- ●BZOJ 1531 [POI2005]Bank notes
题链: http://www.lydsy.com/JudgeOnline/problem.php?id=1531 题解: 单调队列优化多重背包DP (弱弱的我今天总算是把这个坑给填了...) 令V[i ...