For tutoring please call 856.777.0840 I am a recently retired registered nurse who helps nursing students pass their NCLEX. I have been a nurse since 1997. I have worked in a lot of nursing fields. In the command prompt type ping domain.com and press Enter. This will provide ping results from your computer to domain.com. You can also use ping with an IP, i.e. Linux: Open a Terminal window and type ping domain.com. Mac OS: Go to the Applications Utilities Network Utility ping and specify a domain or IP.
Adding a timestamp to ping's output
Here's a command to save a record of ten thousand pings with a timestamp. This code, to be run in a BASH terminal command line, combines the methods, found in the references below, of adding a timestamp and saving the output to a file:
- Explanation of commands in the above code
- Send a periodic message to google.com asking for a simple reply. The result is the number of each ping in series (icmp_seq), the maximum amount of IP routers allowed to transmit the message, and the time taken by the round-trip.
Ping (itch) (liven) Mac Os Catalina
- Wait 2 seconds between pings.
- Repeat the ping ten thousand times.
- 'Pipe' the output to the following command.
- If there is any output from the pipe, set the variable pong to the output and do the following commands up to 'done', returning here to check for more output. Go to the command after 'done' if there is no more output.
- Copy the following to the standard output.
- Print the current date, without trying to set it (-j), in the format of year-month-date hour:minute:second.
- Also print the output from the ping command stored in the variable pong.
- Redirect the output of echo from standard output to the end of the file PingsWithDate.txt in the user folder. If the file doesn't yet exist, a new file will be made, else the results will be appended to the file without overwriting the existing contents.
- Typical output
References
- Advanced bash scripting guide
- http://tldp.org/LDP/abs/html/io-redirection.html
- Add timestamp to Ping
- http://tech.jocke.no/2010/09/27/add-timestamp-to-ping/
Ping (itch) (liven) Mac Os X
Retrieved from 'http://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&oldid=2814'