Courseiva
Networking →easyMultiple Choice

LFCS Networking Practice Question

Which command displays the listening UDP ports on a Linux system?

⚠ Common exam trap

It's easy for candidates to confuse the `-t` (TCP) and `-u` (UDP) flags, or assume that `netstat -tln` or `ss -tln` will show all listening ports, forgetting that UDP requires explicit `-u` filtering.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

ss -uln

`ss -uln` specifically displays listening UDP sockets. The `-u` flag filters for UDP, `-l` shows only listening sockets, and `-n` displays numeric addresses and ports (avoiding DNS resolution). This is the most precise command for listing listening UDP ports.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    ss -a

    Why it's wrong here

    Omitting the -u flag means ss -a lists both TCP and UDP sockets, so listening UDP ports are not isolated. It is tempting because -a does show all sockets, and it would be correct when you genuinely want a combined TCP and UDP listing rather than UDP alone.

  • ✗

    ss -tln

    Why it's wrong here

    The -t flag restricts ss to TCP sockets, so listening UDP ports are omitted entirely. It is tempting because ss -tln is the standard way to list listening TCP ports, and would be correct if the question asked about TCP rather than UDP.

  • ✓

    ss -uln

    Why this is correct

    -u for UDP, -l for listening, -n for numeric.

  • ✗

    netstat -tln

    Why it's wrong here

    The -t flag limits netstat to TCP sockets, so UDP listeners are never shown. It tempts because -l and -n correctly filter listening sockets and numeric ports, but the protocol selector is wrong; -u is needed for UDP.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This LFCS question is part of Courseiva's 406-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.