
The ports that are listed can be easily checked to see what their usual purpose is: We’ve got an extra column called “PID/program name.” This column lists the PID and name of the process using each of the sockets. Tcp6 0 0 ip6-localhost:smtp :* LISTEN 1176/master Tcp6 0 0 ip6-localhost:ipp :* LISTEN 7687/cupsd Tcp 0 0 localhost:domain 0.0.0.0:* LISTEN 6927/systemd-resolv Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Here’s that output in a formatted table: Active Internet connections (servers and established) We use sudo to make sure we receive all of the information that is available, including any information that would normally require root permissions. Let’s see what the PIDs and process names are for the processes using a TCP socket that is in the listening state. It can be useful to see the process ID (PID) of the process using a socket, together with the name of that process. The Unix domain socket type can be one of the following: Path: The file system path to the socket.I-Node: The file system inode associated with this socket.SO_NOSPACE, shown as N, means there is no space to write data to the socket (i.e., the send buffer is full). SO_WAITDATA, shown as W, means there is data waiting to be read. Flags: This is usually set to ACC , which represents SO_ACCEPTON, meaning the socket is waiting for a connection request.The number of attached processes connected to this socket. Proto: The protocol used by this socket.CLOSED: There is no connection, so the socket has been terminated.It is now waiting to make sure that acknowledgment was received. This socket sent an acknowledgment to the remote socket to let it know that it received the remote socket’s termination request. This socket is waiting for an acknowledgment of the connection termination request it sent to the remote socket.


This socket is waiting for a connection termination request acknowledgment from the remote socket. This socket is waiting for a connection termination request from the local user. This socket is waiting for a connection termination request from the remote socket. This socket is waiting for a connection termination request from the remote socket, or for an acknowledgment of a connection termination request that was previously sent from this socket. A working connection has been established between the server and the client, allowing data to be transferred between the two. This socket is waiting for a connection acknowledgment after accepting a connection request. This socket has made a connection request and is waiting to see if it will be accepted. The socket is waiting for a connection request.
