Use iputils ping to send three echo requests to 2001:db8::1 and exit automatically.
Do not use IPv4.
Which command is appropriate?
ping -6 forces IPv6 and -c 3 sets three requests before exit.
Detailed explanation
ping -4 -c 3 2001:db8::1Incorrect. -4 forces IPv4 and conflicts with the IPv6 address.
Incorrect. -4 forces IPv4 and conflicts with the IPv6 address.
ping -c 6 2001:db8::1Incorrect. It sends six requests rather than three.
Incorrect. It sends six requests rather than three.
ping -s 3 2001:db8::1Incorrect. -s changes payload size and does not set the request count.
Incorrect. -s changes payload size and does not set the request count.
ping -6 -c 3 2001:db8::1Correct. It forces IPv6 and sends three requests.
Correct. It forces IPv6 and sends three requests.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '-6=IPv6' '-c 3=three requests'Expected result
-6=IPv6
-c 3=three requestsKey points
- -6 forces IPv6
- -c sets the count
- -s sets payload size
Notes
- Environment: iputils pingのoption対応表(外部通信なし)
- 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.