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

相关文章:

  • 2021-05-27
  • 2022-02-20
  • 2021-05-22
  • 2021-05-30
  • 2021-10-16
  • 2022-02-26
  • 2021-10-03
  • 2022-12-23
猜你喜欢
  • 2021-06-01
  • 2021-06-22
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案