Skip to content

Instantly share code, notes, and snippets.

@razhangwei
Last active May 9, 2019 14:15
Show Gist options
  • Save razhangwei/872b0ba8b4df62d6893cceb9f09c8ca9 to your computer and use it in GitHub Desktop.
Save razhangwei/872b0ba8b4df62d6893cceb9f09c8ca9 to your computer and use it in GitHub Desktop.
save std output to local log file named with current datetime #Unix
# IDs: 1 for stdout, 2 for stderr -2>&1: redirect stderr to stdout; vice versa for 1>&2.
./some_command 2>&1 | tee $(date +"%Y%m%d%H%M").log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment