How Linux looks at 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 as 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
Note: The contents of the essay are from the online data collation, for reference only.
How Linux can see which process the port is using