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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值