Search code examples
linuxlocalhostopenhab

How to find out which port number a process is using and the process using a specific port number


I'm beginner with openhab, after launching the server /etc/init.d/openhab2 start i got that [ ok ] Starting openhab2 (via systemctl): openhab2.service, but I still have no access to the platform via http://localhost:8080/ I want to know :

which process is using port 8080

which port openhab runs on

thanks


Solution

  • you can use lsof,

    lsof | grep TCP | grep 8080 and lsof | grep openhab | grep TCP

    if a process forks and the child process is the one that is using a port it may not work as expected