-
This article describes how Linux can see how a port is consumed by which process:
1. Lsof-i: Port number
2. Netstat-tunlp|grep Port number
can see which process is consuming the specified port
"Step One" lsof-i
The lsof-i is used to display conditions that match the condition, and lsof (list open files) is a tool that lists open files for the current system. To execute the lsof-i command with the root user
"Step Two" Lsof-i: Port number
Lsof-i: Port number used to view the occupancy of a port, for example, to view ports 22nd usage, lsof-i:22
"Step three" NETSTAT-TUNLP
NETSTAT-TUNLP is used to display TCP,UDP ports and processes, and other related situations
"Step Four" Netstat-tunlp|grep port number
Netstat-tunlp|grep port number for viewing the process of a specified port number, such as viewing Port 22, Netstat-tunlp|grep 22
How Linux looks at which process the port is consuming