Prepare for the CompTIA Network+ Exam. Utilize interactive quizzes and multiple-choice questions with explanations. Boost your readiness and achieve exam success now!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which command shows all active connections and listening ports on a device?

  1. dig

  2. netstat -a

  3. tracert

  4. ping

The correct answer is: netstat -a

The command that shows all active connections and listening ports on a device is "netstat -a." This command is widely used in network management to provide detailed information about the network connections on a machine. The "-a" option specifically indicates that the command should report all connections and listening ports, allowing administrators to diagnose network issues, monitor traffic, and identify potential unauthorized connections. Other commands listed do not serve this purpose. "dig" is primarily used for querying DNS records, providing information about domain names and IP addresses. "tracert" traces the route that packets take to reach a specific destination, showing each hop along the way but not the current connections. "ping" is used to test the reachability of a host and measure the round-trip time for messages sent to that destination; it does not provide information about open ports or established connections. Hence, "netstat -a" is the suitable choice for displaying all active connections and listening ports.