fuser 命令用指定的文件或者文件系统显示进程进程号,默认情况下每一个文件名后会跟着一个字母来表示类型
-l 显示信号
-4 IPv4
-6 IPv6
-a 与程序相关的所有文件
-k 删除程序相关的所有文件
-I 互交模式
-s 不显示处理信息
-u PID显示用户名
-v 运行时,显示相信处理信息
- 清零
-m 挂载文件系统
-signal 发送信号
-n 指定关键字进行搜索,如 文件、UDP、TCP
-V 显示版本显示
【文件类型说明】
c:当前目录
e:扩展
f:打开的文件
r:跟目录
m:共享库
[root@redhat ~]# fuser -l #显示信号 HUP INT QUIT ILL TRAP ABRT IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS UNUSED [root@redhat ~]# fuser -a /root #显示与/root 目录相关的进程 /root: 4552c 4630c 4661c 4664c 4666c 4669c 4671c 4732c 4733c 4735c 4736c 4740c 4741c 4743c 4744c 4750c 4751c 4767c 11065c 30632c 31755c [root@redhat ~]# fuser -k /root #杀死与/root 目录相关的进程 /root: 4552c 4630c 4661c 4664c 4666c 4669c 4671c 4732c 4733c 4735c 4736c 4740c 4741c 4743c 4744c 4750c 4751c 4767c 11065c 30632c 31755c
# fuser -uv . #查询当前目录下的进程
USER PID ACCESS COMMAND
.: root 3784 ..c.. (root)bash
root 3815 ..c.. (root)bash
root 9998 ..c.. (root)bash
root 28673 ..c.. (root)vi
[root@localhost test]# fuser -km /dev/sdb2
/dev/sdb2: 7251c
//杀掉正在使用的挂载用户,下面另外一个执行结果
[root@localhost test]# cd /mnt
[root@localhost mnt]# Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(新建会话) at 15:50:05.
Type `help' to learn how to use Xshell prompt.
[D:\~]$
评论(0)
暂无评论