Which Linux command is commonly used to list both active connections and sockets, including listening ports?

Study for the ITS Networking Test. Prepare with flashcards and multiple-choice questions. Each question includes hints and explanations. Get ready to excel in your exam!

Multiple Choice

Which Linux command is commonly used to list both active connections and sockets, including listening ports?

Explanation:
Listing active connections and listening sockets is done with ss, the Linux tool for socket statistics. It’s designed to quickly show both current network connections (like established TCP/UDP sessions) and the sockets that are listening for new ones. You can tailor the output to your needs with options such as -t for TCP, -u for UDP, -l to show listening sockets, -a for all sockets, -p to include the process owning each socket, and -n to display numeric addresses and ports. This makes ss a fast, unified way to see who your programs are connected to and which ports are open for incoming connections, all in one view. Netstat can provide similar information but is considered older and less favored on modern systems; ifconfig shows interface details rather than connections, and ls has no relation to network sockets. So ss is the best fit for listing both active connections and sockets, including listening ports.

Listing active connections and listening sockets is done with ss, the Linux tool for socket statistics. It’s designed to quickly show both current network connections (like established TCP/UDP sessions) and the sockets that are listening for new ones. You can tailor the output to your needs with options such as -t for TCP, -u for UDP, -l to show listening sockets, -a for all sockets, -p to include the process owning each socket, and -n to display numeric addresses and ports. This makes ss a fast, unified way to see who your programs are connected to and which ports are open for incoming connections, all in one view. Netstat can provide similar information but is considered older and less favored on modern systems; ifconfig shows interface details rather than connections, and ls has no relation to network sockets. So ss is the best fit for listing both active connections and sockets, including listening ports.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy