我尝试在tomcat /bin目录下使用。/shutdown.sh关闭tomcat。但发现服务器没有正确关闭。因此我无法重新启动我的tomcat运行在端口8080上。
我想终止在8080上运行的tomcat进程。我首先想要在特定端口(8080)上运行的进程列表,以便选择要终止哪个进程。
我尝试在tomcat /bin目录下使用。/shutdown.sh关闭tomcat。但发现服务器没有正确关闭。因此我无法重新启动我的tomcat运行在端口8080上。
我想终止在8080上运行的tomcat进程。我首先想要在特定端口(8080)上运行的进程列表,以便选择要终止哪个进程。
当前回答
在我的情况下,cent os在建议的答案中有一些问题。所以我使用了以下解决方案:
ss -tanp | grep 65432 | head -1 | grep -Po "(?<=pid=).*(?=,)" | xargs kill
其他回答
Linux:如果你知道端口,你可以使用这个命令:
netstat -plten | grep LISTEN | grep 8080
AIX:
netstat -Aan | grep LISTEN | grep 8080
然后使用第一列(例如:f100050000b05bb8)并运行以下命令:
rmsock f100050000b05bb8 tcpcb
杀死进程。
只有以下命令对我有用:
ps -aux | grep 8000
然后:
sudo kill <PID>
Lsof -i tcp:8000 该命令列出8000端口上运行的进程信息 kill -9 [PID] 该命令终止进程
sudo apt-get install psmisc (or sudo yum install psmisc)
sudo fuser 80/tcp
结果: 80/tcp: 1858 1867 1868 1869 1871
逐个杀死进程
杀死-9 1858
使用命令
sudo netstat -plten |grep java
使用grep Java作为tomcat使用Java作为他们的进程。
它将显示带有端口号和进程id的进程列表
tcp6 0 0 :::8080 :::* LISTEN
1000 30070621 16085/java
“/java”前面的数字是进程号。现在使用kill命令终止进程
kill -9 16085
-9表示进程将被强制终止。