<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://shawnreeves.net//wiki/index.php?action=history&amp;feed=atom&amp;title=Ping_with_timestamp_on_Mac_OS_X</id>
	<title>Ping with timestamp on Mac OS X - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://shawnreeves.net//wiki/index.php?action=history&amp;feed=atom&amp;title=Ping_with_timestamp_on_Mac_OS_X"/>
	<link rel="alternate" type="text/html" href="https://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&amp;action=history"/>
	<updated>2026-04-15T06:30:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&amp;diff=2814&amp;oldid=prev</id>
		<title>Shawn: /* Adding a timestamp to ping&#039;s output */</title>
		<link rel="alternate" type="text/html" href="https://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&amp;diff=2814&amp;oldid=prev"/>
		<updated>2016-05-16T16:52:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Adding a timestamp to ping&amp;#039;s output&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:52, 16 May 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  1&amp;gt;&amp;gt;~/PingsWithDate.txt&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  1&amp;gt;&amp;gt;~/PingsWithDate.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Redirect the output of echo from standard output to the end of the file PingsWithDate.txt in the user folder. If the file doesn&amp;#039;t yet exist, a new file will be made, else the results will be appended to the file without overwriting the existing contents.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Redirect the output of echo from standard output to the end of the file PingsWithDate.txt in the user folder. If the file doesn&amp;#039;t yet exist, a new file will be made, else the results will be appended to the file without overwriting the existing contents.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;Typical output&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:28 PING google.com (172.217.4.46): 56 data bytes&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:28 64 bytes from 172.217.4.46: icmp_seq=0 ttl=55 time=17.574 ms&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:30 64 bytes from 172.217.4.46: icmp_seq=1 ttl=55 time=18.960 ms&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:32 64 bytes from 172.217.4.46: icmp_seq=2 ttl=55 time=19.141 ms&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:34 64 bytes from 172.217.4.46: icmp_seq=3 ttl=55 time=18.279 ms&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 2016-05-16 12:26:36 64 bytes from 172.217.4.46: icmp_seq=4 ttl=55 time=20.297 ms&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==References==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==References==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Shawn</name></author>
	</entry>
	<entry>
		<id>https://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&amp;diff=2813&amp;oldid=prev</id>
		<title>Shawn: Created page with &quot;==Adding a timestamp to ping&#039;s output== Here&#039;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, combine...&quot;</title>
		<link rel="alternate" type="text/html" href="https://shawnreeves.net//wiki/index.php?title=Ping_with_timestamp_on_Mac_OS_X&amp;diff=2813&amp;oldid=prev"/>
		<updated>2016-05-16T16:50:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Adding a timestamp to ping&amp;#039;s output== Here&amp;#039;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, combine...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Adding a timestamp to ping&amp;#039;s output==&lt;br /&gt;
Here&amp;#039;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:&lt;br /&gt;
 ping -i 2 -c 10000 google.com | while read pong; do echo &amp;quot;$(date -j &amp;#039;+%Y-%m-%d %H:%M:%S&amp;#039;) $pong&amp;quot; 1&amp;gt;&amp;gt;~/PingsWithDate.txt;done&lt;br /&gt;
;Explanation of commands in the above code:&lt;br /&gt;
 ping google.com&lt;br /&gt;
: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.&lt;br /&gt;
 -i 2&lt;br /&gt;
:Wait 2 seconds between pings.&lt;br /&gt;
 -c 10000&lt;br /&gt;
:Repeat the ping ten thousand times.&lt;br /&gt;
 |&lt;br /&gt;
:&amp;quot;Pipe&amp;quot; the output to the following command.&lt;br /&gt;
 while read pong; do&lt;br /&gt;
:If there is any output from the pipe, set the variable pong to the output and do the following commands up to &amp;quot;done&amp;quot;, returning here to check for more output. Go to the command after &amp;quot;done&amp;quot; if there is no more output.&lt;br /&gt;
 echo &amp;quot;&amp;quot;&lt;br /&gt;
:Copy the following to the standard output.&lt;br /&gt;
 $(date -j &amp;#039;+%Y-%m-%d %H:%M:%S&amp;#039;)&lt;br /&gt;
:Print the current date, without trying to set it (-j), in the format of year-month-date hour:minute:second.&lt;br /&gt;
 $pong&lt;br /&gt;
:Also print the output from the ping command stored in the variable pong.&lt;br /&gt;
 1&amp;gt;&amp;gt;~/PingsWithDate.txt&lt;br /&gt;
:Redirect the output of echo from standard output to the end of the file PingsWithDate.txt in the user folder. If the file doesn&amp;#039;t yet exist, a new file will be made, else the results will be appended to the file without overwriting the existing contents.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
;Advanced bash scripting guide: http://tldp.org/LDP/abs/html/io-redirection.html&lt;br /&gt;
;Add timestamp to Ping:http://tech.jocke.no/2010/09/27/add-timestamp-to-ping/&lt;br /&gt;
[[Category:Internet]]&lt;/div&gt;</summary>
		<author><name>Shawn</name></author>
	</entry>
</feed>