List current filter-table rules without name resolution and include packet and byte counters.
Which command is appropriate?
iptables -L -n -v lists rules, keeps addresses numeric, and shows verbose counters.
Detailed explanation
iptables -F -n -vIncorrect. -F flushes rules.
Incorrect. -F flushes rules.
iptables -L -n -vCorrect. It lists numeric rules with counters.
Correct. It lists numeric rules with counters.
iptables -A -n -vIncorrect. -A appends a rule.
Incorrect. -A appends a rule.
iptables -D -n -vIncorrect. -D deletes a rule.
Incorrect. -D deletes a rule.
Try it yourself
An example you can run in a temporary verification environment.
iptables --help 2>&1 | grep -E -- '^-L|--list|^-n|^-v' | head -n 4Expected result
list、numeric、verboseに関するhelp行Key points
- -L lists
- -n numeric
- -v includes counters
Notes
- Environment: iptables help / ルール変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.