We can use lsof or netstat to find which process is listening on a port. Here are the steps:
- To see which process is listening on port 8080 using netstat
sudo netstat -anv | grep [.]8080
tcp4 0 0 127.0.0.1.8080 *.* LISTEN 131072 131072 48921 0 0x0100 0x00000106
- To see which process is listening using lsof
sudo lsof -i :8080
orsudo lsof -i -P | grep LISTEN | grep :8080
- Once you get the process id, use the ps command to see its name
ps -f -p 48921