The ss command
another utility to investigate sockets 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.
Options in the examples
-l, --listening- Display only listening sockets (these are omitted by default).
-n, --numeric- Do not try to resolve service names. Show exact bandwidth values, instead of human-readable.
-p, --processes- Show process using socket.
-t, --tcp- Display TCP sockets.
-u, --udp- Display UDP sockets.
Examples
ss -tlnpTCP listening ports with process
ss -tulnpTCP+UDP listening
sudo ss -tlnp | grep :80
sudo ss -tlnpWhich program listens on which port?