Linux基础之重定向stdout/stderr

启动进程后查看日志(stdout和stderr)

1 nohup+tail

# nohup $cmd > /path/to/file 2>&1 &
# tail -f /path/to/file

append
# nohup $cmd >> /path/to/file 2>&1 &

 

2 tee

# $cmd|& tee /path/to/file

append
# $cmd|& tee -a /path/to/file

 

posted @ 2019-05-20 20:01  匠人先生  阅读(1143)  评论(0编辑  收藏  举报