Difference between revisions of "Port to PID"
From Noah.org
Jump to navigationJump to searchLine 9: | Line 9: | ||
</pre> | </pre> | ||
− | + | So to find which process is listening on port 80 (expect some http server): | |
+ | |||
<pre> | <pre> | ||
lsof -i :80 | lsof -i :80 |
Revision as of 16:56, 28 August 2008
Use the `lsof` command to find which process is listening on a given port.
For example, I saw that some process was already using port 69 (normally TFTP). I did not expect this port to be in use, so I ran the following command to find out which process what listening on port 69:
lsof -i :69
So to find which process is listening on port 80 (expect some http server):
lsof -i :80
You can also look for files opened by a given user or command:
lsof -u USER
lsof -c COMMAND