210-255 · Question #91
Which netstat command show ports?
The correct answer is B. netstat -l. The netstat -l command filters output to display only sockets in the listening state and their associated ports.
Question
Which netstat command show ports?
Options
- Anetstat -a
- Bnetstat -l
- Cnetstat -v
- Dnetstat -g
How the community answered
(29 responses)- A3% (1)
- B90% (26)
- D7% (2)
Why each option
The netstat -l command filters output to display only sockets in the listening state and their associated ports.
netstat -a shows all active connections AND listening ports combined, not exclusively listening ports.
The netstat -l (--listening) option restricts output to sockets that are actively listening for incoming connections, directly showing which ports are open and waiting for traffic. This is more targeted than other options because it isolates listening ports without mixing in established or other connection states.
netstat -v enables verbose mode to add extra detail to existing output; it does not filter or display ports specifically.
netstat -g displays multicast group membership information and has no relationship to port listings.
Concept tested: netstat command options for viewing listening ports
Source: https://linux.die.net/man/8/netstat
Topics
Community Discussion
No community discussion yet for this question.