fuser命令使用心得
fuser命令可用于查看正使用指定file, file system, socket port的进程信息。使用-k参数可将这些进程杀掉,-i则在杀掉进程前给出提示
例子:
[root@bogon ~]# fuser -k -i 80/tcp
80/tcp: 30922 30923
Kill process 30922 ? (y/N) y
Kill process 30923 ? (y/N) y
其他参数如下:
-a display unused files too
-c mounted FS
-f silently ignored (for POSIX compatibility)
-i ask before killing (ignored without -k)
-k kill processes accessing the named file
-l list available signal names
-m show all processes using the named filesystems
-n SPACE search in this name space (file, udp, or tcp)
-s silent operation
-SIGNAL send this signal instead of SIGKILL
-u display user IDs
-v verbose output
-V display version information
-4 search IPv4 sockets only
-6 search IPv6 sockets only
- reset options