Last active
May 9, 2019 14:15
-
-
Save razhangwei/872b0ba8b4df62d6893cceb9f09c8ca9 to your computer and use it in GitHub Desktop.
save std output to local log file named with current datetime #Unix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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