Send exactly four ICMP echo requests to 192.0.2.1 and then exit.
Use the common iputils ping.
Which command is appropriate?
For iputils ping, -c COUNT limits the number of echo requests. -i, -s, and -W control different settings.
Detailed explanation
ping -c 4 192.0.2.1Correct. -c 4 sends four requests and then exits.
ping -i 4 192.0.2.1Incorrect. -i sets the interval between requests.
ping -s 4 192.0.2.1Incorrect. -s sets the payload size.
ping -W 4 192.0.2.1Incorrect. -W controls response waiting time, not request count.
Try it yourself
An example you can run in a temporary verification environment.
ping -h 2>&1 | grep -E -- '-c.*count' | head -n 1Expected result
-c countが送信回数を指定することを示すhelp行Key points
- -c means count
- The command exits after the count
- Distinguish -i and -W
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
Network interface
A host attachment whose link state and addresses can be managed.
Connection profile
Saved settings used to activate a persistent network connection.
Routing table
Rules that select the next hop for each destination network.