linux下注销其它用户或者tty的命令
来源:互联网 发布:看本子的软件 编辑:程序博客网 时间:2024/05/16 15:10
出处:http://blog.chinaunix.net/uid-12115233-id-390539.html
需求:
假设w输出类似这样
user1 pts/0 ...................... -bash
user1 pts/1 ...................... -bash
user2 pts/2 ...................... -bash
user2 pts/3 ...................... w
有没有命令对指定的tty注销用户?又有没有命令对指定的用户注销所有tty?
总感觉用ps kill -9 太暴力了点,也不方便......
其实可以通过skill命令来实现:
# skill
Usage: skill [signal to send] [options] process selection criteria
Example: skill -KILL -v pts/*
The default signal is TERM. Use -l or -L to list available signals.
Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0.
Alternate signals may be specified in three ways: -SIGKILL -KILL -9
General options:
-f fast mode This is not currently useful.
-i interactive use You will be asked to approve each action.
-v verbose output Display information about selected processes.
-w warnings enabled This is not currently useful.
-n no action This only displays the process ID.
Selection criteria can be: terminal, user, pid, command.
The options below may be used to ensure correct interpretation.
-t The next argument is a terminal (tty or pty).
-u The next argument is a username.
-p The next argument is a process ID number.
-c The next argument is a command name.
-t 这个参数可以多利用
- linux下注销其它用户或者tty的命令
- Linux注销其它用户
- 注销linux用户的方法
- 多种方法注销linux下活动用户
- linux下的tty是什么
- 注销其他已登录用户的命令
- linux其它的命令
- CentOS 注销在线用户, Linux 注销用户
- Linux实现用户注销
- 注销linux用户
- Linux注销用户
- linux注销指定用户
- linux注销登录用户
- 怎样用linux命令知道系统是ubuntu还是redhat或者其它的系统
- 怎样用linux命令知道系统是ubuntu还是redhat或者其它的系统?
- 注销linux/solaris桌面的命令
- linux命令切换tty
- linux系统下【用户切换、注销、锁住屏幕】
- sublime text3 安装Package Control包
- 3Sum 3个数的和为0 遍历+左右循环
- 关于高质量PCB设计经验总结
- 集线器交换机共享带宽独享带宽的理解
- 玩转字符串
- linux下注销其它用户或者tty的命令
- Coin change
- 求两个数组的交集
- 判断网络
- RAC 实例迁移到单实例 -- 使用RMAN Duplicate
- python定义语言级的全局函数
- 3Sum Closest 3个数字的和等于或者最接近与目标数
- 写博客的种种好处
- apk反编译