ceph存储 centos下fuser命令小结
2014-12-31 20:12
429 查看
fuser 概述
fuser命令是用来显示所有正在使用着指定的file, file system 或者 sockets的进程信息。例一:
#fuser –m –u /mnt/usb1 /mnt/usb1: 1347c(root) 1348c(guido) 1349c(guido) |
fuser会显示正在使用指定的file,file system 或者 sockets的进程的PID。在默认的显示模式下,每个文件名之后会跟随一个字符,用来指示当前的访问类型。
如下所示:
c current directory.
e executable being run.
f open file. F open file for writing.
r root directory.
m mmap'ed file or shared library
同时fuser 可以用来查找哪些进程正在使用指定的network port。
[root@bl25p-19 /]# fuser -v -n tcp 111 USER PID ACCESS COMMAND 111/tcp: rpc 2848 F.... portmap |
fuser 的返回值:
fuser如果没有找到任何进程正在使用指定的file, filesystem 或 socket, 或者在查找过程中发生了fatal error,则返回non-zero 值。fuser如果找到至少一个进程正在使用指定的file, filesystem 或 socket,则返回zero。
fuser 常用场景
fuser通常被用在诊断系统的“resource busy”问题,通常是在你希望umount指定的挂载点得时候遇到。 如果你希望kill所有正在使用某一指定的file, file system or sockets的进程的时候,你可以使用-k option。fuser –k
/path/to/your/filename
这时fuser会向所以正在使用/path/to/your/filename的进程发送SIGKILL。如果你希望在发送之前得到提示,可以使用-i 选项。
fuser –k –i
/path/to/your/filename
fuser的其他有用的参数
-k kills all process accessing a file. For examplefuser -k /path/to/your/filename kills all processes accessing this directory without confirmation. Use -i for confirmation
-i interactive mode. Prompt before killing process
-v verbose. -u append username
-a display all files
-m name specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified,
it is automatically changed to name/. to use any file system that might be mounted on that directory.
参考:
[1] man fuser[2] http://en.wikipedia.org/wiki/Fuser_%28Unix%29
相关文章推荐
- ceph存储 centos下tail命令详解
- ceph存储 CentOS怎么查看某个命令的源代码yum
- ceph存储 centos中Git常用命令
- ceph存储 centos下Git常用命令查询
- ceph存储 centos下通过Linux的ACL命令学习ACL权限分配原理
- ceph存储 Centos下建立RPM包中spec文件编写说明书
- Centos6.5下Ceph存储集群的搭建
- Centos 6.5下配置tgt后端存储为ceph
- CentOS-7命令小结(一)
- ceph存储 linux中的零拷贝技术小结
- ceph存储 linux下install命令参数详解
- fuser 命令小结
- ceph存储 Linux下date命令,格式化输出,时间设置
- fuser 命令小结
- ceph存储 centos下chkconfig详解
- ceph存储 centos下lsof详解
- CentOS常用命令小结
- CentOS常用命令小结
- fuser 命令小结
- ceph存储 centos7+0.87源码安装ceph集群问题汇总