[root@mysql-master ~]# fuser -m /dev/sda1
bash: fuser: 未找到命令
第一种方法:
[root@mysql-master ~]# yum whatprovides fuser
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* epel: mirrors.yun-idc.com
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
base/7/x86_64/filelists_db | 6.9 MB 00:00:02
epel/x86_64/filelists | 10 MB 00:00:01
extras/7/x86_64/filelists_db | 595 kB 00:00:00
updates/7/x86_64/filelists_db | 2.9 MB 00:00:00
psmisc-22.20-15.el7.x86_64 : Utilities for managing processes on your system
源 :base
匹配来源:
文件名 :/usr/sbin/fuser
第二种
[root@mysql-master ~]# yum provides fuser
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* epel: mirrors.yun-idc.com
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
psmisc-22.20-15.el7.x86_64 :Utilities for managing processes on your system
源 :base
匹配来源:
文件名 :/usr/sbin/fuser
安装软件
[root@mysql-master ~]# yum -y install psmisc
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* epel: mirrors.yun-idc.com
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 psmisc.x86_64.0.22.20-15.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=======================================================================================
Package 架构 版本 源 大小
=======================================================================================
正在安装:
psmisc x86_64 22.20-15.el7 base 141 k
[root@mysql-master ~]# fuser --help
fuser: Invalid option --help
Usage: fuser [-fMuvw] [-a|-s] [-4|-6] [-c|-m|-n SPACE] [-k [-i] [-SIGNAL]] NAME...
fuser -l
fuser -V
Show which processes use the named files, sockets, or filesystems.
-a,--all display unused files too
-i,--interactive ask before killing (ignored without -k)
-k,--kill kill processes accessing the named file
-l,--list-signals list available signal names
-m,--mount show all processes using the named filesystems or block device
-M,--ismountpoint fulfill request only if NAME is a mount point
-n,--namespace SPACE search in this name space (file, udp, or tcp)
-s,--silent silent operation
-SIGNAL send this signal instead of SIGKILL
-u,--user display user IDs
-v,--verbose verbose output
-w,--writeonly kill only processes with write access
-V,--version display version information
-4,--ipv4 search IPv4 sockets only
-6,--ipv6 search IPv6 sockets only
- reset options
udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]