How to Check Which Program Is Using a Port in Linux

While using a Linux system, you may occasionally encounter a port conflict when starting a service, which prevents the service from launching.
So how can you check which service is occupying a specific port?
You can use the following command:

lsof -i:22

As shown above, using port 22 as an example, we can see it is occupied by the SSH service.
To query a different port, simply replace the port number in the command above.

Leave a Comment

Your email address will not be published.