Skip to content

Instantly share code, notes, and snippets.

@olimortimer
Created September 19, 2014 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olimortimer/9c6c3cf8d1364f4fe9d2 to your computer and use it in GitHub Desktop.
Save olimortimer/9c6c3cf8d1364f4fe9d2 to your computer and use it in GitHub Desktop.
Shell: Ping with timestamp
# Ping with timestamp
ping google.com | while read pong; do echo "$(date): $pong"; done
# Ping to file
ping google.com >> ping.txt
# Ping with timestamp to file
ping google.com | while read pong; do echo "$(date): $pong"; done >> ping.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment