Using lsof
The lsof (stands for list of open files) provides information on file and ports which are opened by any process currently running. Below is an example:
# lsof -i -nP | grep httpd
httpd 2318 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
httpd 2319 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
httpd 2322 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
# lsof -i -nP | grep httpd
httpd 2318 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
httpd 2319 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
httpd 2322 apache 16u IPv4 0x019922bc 0t0 TCP 127.0.0.1:8000 (LISTEN)
Labels: unix
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home