Thursday, March 5, 2009

What process is running on the port?

Have you wondered what process is running on the port of your Linux box? The command to know the process that is running on the port is:

#lsof

This command comes handy with the #nmap program that identifies what ports are open. The command however tries to list all open files and therefore expect a long list to run through your screen. If you just want to investigate a particular port say port 898, use #lsof with grep:

#lsof | grep 898

This will list the open files with the particular port 898.

No comments: