Linux – Which application is using port 8080

Always, Java developers need to know which application is using the high demand 8080 port. In this tutorial, we will show you two ways to find out which application is using port 8080 on Linux.

1. lsof + ps command

1.1 Bring up the terminal, type lsof -i :8080

$ lsof -i :8080

COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    10165 mkyong   52u  IPv6 191544      0t0  TCP *:http-alt (LISTEN)
Note
If multiple result, try  lsof -i :8080 | grep LISTEN

1.2 PID 10165 is using port 8080, type ps -ef | grep 10165 to find out the application details.

$ ps -ef | grep 10165

mkyong   10165  4364  1 11:58 ?        00:00:20 /opt/jdk/jdk1.8.0_66/jre/bin/java
//...
-Djava.endorsed.dirs=/home/mkyong/software/apache-tomcat-8.0.30/endorsed
-classpath /home/mkyong/software/apache-tomcat-8.0.30/bin/bootstrap.jar:
/home/mkyong/software/apache-tomcat-8.0.30/bin/tomcat-juli.jar
-Dcatalina.base=/home/mkyong/.IntelliJIdea15/system/tomcat/Unnamed_hc_2
-Dcatalina.home=/home/mkyong/software/apache-tomcat-8.0.30
-Djava.io.tmpdir=/home/mkyong/software/apache-tomcat-8.0.30
/temp org.apache.catalina.startup.Bootstrap start

Answer : IntelliJ IDEA + Tomcat 8 is using the port 8080.


2. netstat + ps command

Just different command to do the same thing.Type netstat -nlp | grep 8080 to get the PID and ps it.

$ netstat -nlp | grep 8080

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::8080                 :::*                    LISTEN      10165/java

$ ps -ef | grep 10165

mkyong   10165  4364  1 11:58 ?        00:00:20 /opt/jdk/jdk1.8.0_66/jre/bin/java
//...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值