A Linux administrator needs to check which services are listening on TCP ports on a server. Which command should be used to replace the deprecated netstat command?
Trap 1: nmap localhost
nmap is a port scanner, not the standard tool for quick listening port checks.
Trap 2: ip link show
ip link show displays network interfaces, not listening ports.
Trap 3: dig -t any localhost
dig is for DNS queries, not for checking listening ports.
- A
ss -tlnp
ss -tlnp shows listening TCP ports with process info, replacing netstat.
- B
nmap localhost
Why wrong: nmap is a port scanner, not the standard tool for quick listening port checks.
- C
ip link show
Why wrong: ip link show displays network interfaces, not listening ports.
- D
dig -t any localhost
Why wrong: dig is for DNS queries, not for checking listening ports.