概述:
浪费一些时间总要有些收获才行。
1.netstat -anp|grep 8080 查询8080端口的详情
2.fuser -v -n tcp 8080 查询8080端口对应的进程
3.kill -9 你的进程号
4.ps -aux|grep tomcat 查询tomcat的所有进程
[root@iZuf62p8v9cro017s56dbsZ bin]# netstat -anp|grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 32622/java
[root@iZuf62p8v9cro017s56dbsZ bin]# fuser -v -n tcp 8080
用户 进程号 权限 命令
8080/tcp: root 32622 F.... java
[root@iZuf62p8v9cro017s56dbsZ bin]# ps -aux|grep tomcat
root 32565 0.0 0.0 10692 356 ? Ss 15:54 0:00 jsvc.exec -Dcatalina.home=/home/tomcat/apache-tomcat-default -Dcatalina.base=/home/tomcat/apache-tomcat-default -cp /home/tomcat/apache-tomcat-default/bin/commons-daemon.jar:/home/tomcat/apache-tomcat-default/bin/bootstrap.jar:/home/tomcat/apache-tomcat-default/bin/tomcat-juli.jar -user tomcat -java-home /usr/java/default -pidfile /var/run/tomcat.pid -outfile /home/tomcat/apache-tomcat-default/logs/jsvc_outfile.out -errfile &1 org.apache.catalina.startup.Bootstrap
tomcat 32566 1.3 5.6 3066288 219964 ? Sl 15:54 0:06 jsvc.exec -Dcatalina.home=/home/tomcat/apache-tomcat-default -Dcatalina.base=/home/tomcat/apache-tomcat-default -cp /home/tomcat/apache-tomcat-default/bin/commons-daemon.jar:/home/tomcat/apache-tomcat-default/bin/bootstrap.jar:/home/tomcat/apache-tomcat-default/bin/tomcat-juli.jar -user tomcat -java-home /usr/java/default -pidfile /var/run/tomcat.pid -outfile /home/tomcat/apache-tomcat-default/logs/jsvc_outfile.out -errfile &1 org.apache.catalina.startup.Bootstrap
root 32622 1.4 4.9 3011076 191964 pts/1 Sl 15:54 0:06 /usr/bin/java -Djava.util.logging.config.file=/home/tomcat/apache-tomcat-8.5.8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /home/tomcat/apache-tomcat-8.5.8/bin/bootstrap.jar:/home/tomcat/apache-tomcat-8.5.8/bin/tomcat-juli.jar -Dcatalina.base=/home/tomcat/apache-tomcat-8.5.8 -Dcatalina.home=/home/tomcat/apache-tomcat-8.5.8 -Djava.io.tmpdir=/home/tomcat/apache-tomcat-8.5.8/temp org.apache.catalina.startup.Bootstrap start
root 32673 0.0 0.0 112668 984 pts/1 S+ 16:02 0:00 grep --color=auto tomcat
[root@iZuf62p8v9cro017s56dbsZ bin]#
总结:遇到bug是痛苦的,痛苦特别大的时候,收获也是不菲的。哈哈