ping command options
The ping command has several options that can be used to customize its behaviour and
gather more information about the network connection. Here are some common options:
1. -c count: Specifies the number of packets to send.
Example:
ping -c 5 google.com
This command sends 5 packets to google.com.
2. -i interval: Specifies the interval between packets in seconds.
Example:
ping -i 2 google.com
This command sends packets to google.com with a 2-second interval between each packet.
3. -l preload: Specifies the number of packets to send initially.
Example:
ping -l 3 google.com
This command sends 3 packets to google.com initially, and then continues to send packets
until interrupted.
4. -n: Specifies that the output should only display numerical addresses, without resolving
hostnames.
ping -n google.com
This command displays the IP address of google.com instead of the hostname.
5. -q: Specifies quiet output, only displaying the summary at the end.
Example:
ping -q google.com
This command sends packets to google.com and only displays the summary at the end,
without showing each packet's response.
6. -s packetsize: Specifies the packet size in bytes.
Example:
ping -s 1024 google.com
This command sends packets of size 1024 bytes to google.com.
7. -t ttl: Specifies the time-to-live (TTL) for the packets.
Example:
ping -t 10 google.com
This command sets the TTL to 10 for the packets sent to google.com.
8. -v: Specifies verbose output, displaying more detailed information about each packet.
Example:
ping -v google.com
This command displays detailed information about each packet sent to google.com.
9. -w deadline: Specifies the deadline for the ping command to complete.
Example:
ping -w 10 google.com
This command sets a deadline of 10 seconds for the ping command to complete.
10. -4 or -6: Specifies the IP protocol version to use (IPv4 or IPv6).
Example:
ping -4 google.com
This command uses IPv4 to send packets to google.com.