Linux commands to view all the connection process specified information
A function that often needs to be used to locate a network failure in a process is to find information about all connections. Usually find a port connection information using ss or netstat can easily get, if it is active with other machines to establish the connection information can be obtained through the lsof command.
For example, I want to see the process frps
all the current pid connection information, first obtain the process:
You can see the process pid 4721 , and then through the lsof command to view all the TCP connection information :
From the lsof output can clearly see the frps process to monitor the five ports, and in the 7000 port on the establishment of the three connections , connect the two ends of the ip information can also be found.
The -nP parameter of lsof is used to display the ip address and port number as normal numeric types, otherwise it may be represented by aliases.