Use iputils ping to send exactly three requests to IPv6 loopback.
Explicitly select IPv6 rather than IPv4.
Which command is appropriate?
ping -6 selects IPv6 and -c 3 limits requests to three. ::1 is the IPv6 loopback address.
Detailed explanation
ping -4 -c 3 ::1Incorrect. -4 forces IPv4 and cannot use IPv6 address ::1.
Incorrect. -4 forces IPv4 and cannot use IPv6 address ::1.
ping -6 -c 3 ::1Correct. It selects IPv6 and sends exactly three requests.
Correct. It selects IPv6 and sends exactly three requests.
ping -6 -i 3 ::1Incorrect. -i 3 sets a three-second interval and does not limit count.
Incorrect. -i 3 sets a three-second interval and does not limit count.
ping -c 6 127.0.0.1Incorrect. It tests IPv4 loopback and sends six requests.
Incorrect. It tests IPv4 loopback and sends six requests.
Try it yourself
An example you can run in a temporary verification environment.
ping -h 2>&1 | grep -E -- '-4|-6' | head -n 1Expected result
-4と-6がIPバージョンを選択することを示すhelp行Key points
- -6 selects IPv6
- ::1 is IPv6 loopback
- -c 3 sets the count
Notes
- Environment: iputils ping 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.