美文网首页
find / -type f -name xx | tee /d

find / -type f -name xx | tee /d

作者: withism | 来源:发表于2017-11-10 14:57 被阅读20次

    Note that, /dev/tty is the synonym of the terminal run at current time.

    There are usually 3 demands:

    when I execute a python script

    python script.py

    1.output the result to the file script.log

    python script.py |tee script.log

    Then the output in screen is unchanged, but additionally be copied to the script.log as well.

    2:output the both standard output and error to the file script.log with screen output unchanged.

    python class.py 2>&1 | tee script.log

    3:only pip the output into script.log, without show on the screen.

    python class.py 2>&1 | tee >script.log

    or

    python class.py | tee >script.log

    相关文章

      网友评论

          本文标题:find / -type f -name xx | tee /d

          本文链接:https://www.haomeiwen.com/subject/hbmbmxtx.html