centos open port pid 1

centos open port pid

sudo ss -lptn 'sport = :80'

netstat -ltnp | grep -w '80'

lsof -i :80

Here is what the above code is Doing:
1. ss -lptn ‘sport = :80’
-l: Show only listening sockets.
-p: Show the process using the socket.
-t: Show only TCP sockets.
-n: Show numerical addresses instead of trying to determine symbolic host, port or user names.
‘sport = :80′: Show only sockets on port 80.
2. netstat -ltnp | grep -w ’80’
-l: Show only listening sockets.
-t: Show only TCP sockets.
-n: Show numerical addresses instead of trying to determine symbolic host, port or user names.
-p: Show the process using the socket.
| grep -w ’80’: Show only sockets on port 80.
3. lsof -i :80
-i: Show only Internet sockets.
:80: Show only sockets on port 80.

Similar Posts