linux - 如何在 Bash 中终止 TCP 端口 16969?

标签 linux bash ubuntu tcp

我有一个使用 TCP 端口 16969 的应用程序。它有时需要即时快速重启软件内核。但是如果我启动得太快,我就会被锁定

Exception in thread "main" java.net.BindException: Address already in use

所以我想触发我的 Bash 脚本,它可以用 16969 杀死任何正在运行或监听的端口,但我该怎么做呢?

$ lsof -w -n -i tcp:16969 # this gives me a list of 50 lines but how can I kill them all?

最佳答案

您尝试过使用 tcpkill 吗?

例子:

tcpkill -i eth0 port 21

关于linux - 如何在 Bash 中终止 TCP 端口 16969?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9825698/

相关文章:

android - 将 bash 脚本移植到 java

linux - Bash 在单独的文件中复制多行

bash - Azure CLI 跳过覆盖标志

java - "cannot execute binary file: Exec format error"hdfs命令

wordpress - wordpress 安装必须具有哪些权限才能安全但有效?

c - Linux 视频两次轮询返回 POLLERR with errno EINVAL

linux - 什么是 RT_PREEMPT?它与 preempt rt 有何不同?这些是否意味着对 linux 的相同实时补丁?

linux - 如何在 bash 中拆分单词

python - 当我手动终止特定的 .py 脚本时,如何仍然使用函数?

linux - 为 cron 作业保存 rsync 密码