linuxlsof

lsof -i output explanation


Google said

lsof 
 -i [i] selects the listing of files any of whose Internet address
              matches the address specified in i.  If no address is
              specified, this option selects the listing of all Internet
              and x.25 (HP-UX) network files.

I have the following output

root@Landau:~# lsof -i:8018
COMMAND     PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
celery  1843030 root   10u  IPv4 49086348      0t0  TCP Landau.site.ru:58490->Landau.site.ru:8018 (ESTABLISHED)
python  1941119 root    3u  IPv4 48907368      0t0  TCP *:8018 (LISTEN)
python  1941119 root    4u  IPv4 49092801      0t0  TCP Landau.site.ru:8018->ppp83-237-176-131.pppoe.mtu-net.ru:14800 (ESTABLISHED)

The second line is my process (listening on 8018)

What does it mean -> and ESTABLISED?


Solution

  • The question you asked is:

    What does it mean ->

    It lists that the host:port on left side of -> is connected to host:port on the right side of ->. For example, host Landau.site.ru host has connected from port 8018 to host ppp83-237-176-131.pppoe.mtu-net.ru to port 14800.

    and ESTABLISED?

    It means that the actual TCP connection has been made, SYN -> SYN-ACK -> ACK messages exchanged, and the connection can be used (or, well, is used) to transmit messages.