This command is helpful in determining TCP/IP Networks IP address as well as determines connectivity issues with the network and assists in resolving them. Ping helps determine if the machine being "pinged" is up and running, and an indication of the delay between the machines that ping is issued from and the machine ping is issued to.
Syntax
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [ -k host-list]][-w timeout] destination-list
Switches:
-t Pings the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.
Example:
ping localhost
Or
ping 127.0.0.1
The above command checks if the local host (the user's machine) is up and running. In particular, it checks that the networking stack is running properly and the machine is able to respond to a ping request. Note that pinging the local host does not send information over a network but helps in identifying issues with local networking stack.












