linux删除指定端口的进程
用該命令可以找出使用端口的進程。可寫腳本監控,停止端口及進程~
例如:fuser -n tcp 3306 | ps aux | grep 24594 | grep -v "grep"
若要將使用該端口的進程kill
例如:fuser -k -n tcp 3306
usage: fuser [ -a | -s ] [ -n space ] [ -signal ] [ -kimuv ] name ...
[ - ] [ -n space ] [ -signal ] [ -kimuv ] name ...
fuser -l
fuser -V
-a display unused files too
-k kill processes accessing that file
-i ask before killing (ignored without -k)
-l list signal names
-m mounted FS
-n space search in the specified name space (file, udp, or tcp)
-s silent operation
-signal send 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
udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]
轉載于:https://www.cnblogs.com/win-and-first/archive/2013/03/11/linux1.html
總結
以上是生活随笔為你收集整理的linux删除指定端口的进程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JS 常见事件
- 下一篇: 法国一公路将铺设无线充电系统,电动汽车通