Skip to content

Instantly share code, notes, and snippets.

@luxuia
Created December 11, 2018 07:56
Show Gist options
  • Save luxuia/1684eca74a4a8190fd8580efa84bdf84 to your computer and use it in GitHub Desktop.
Save luxuia/1684eca74a4a8190fd8580efa84bdf84 to your computer and use it in GitHub Desktop.
add timestamp in log
tail -f file | awk '{now=strftime("%F %T%z\t");sub(/^/, now);print}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment