nohup 输出重定向 2015-10-20 12:25 7264人阅读 评论(0) 收藏 举报 http:moralistxp.blog.163.comblogstatic1161103

xiaoxiao2021-02-28  115

 

nohup 输出重定向

  7264人阅读  评论(0)  收藏  举报

http://moralistxp.blog.163.com/blog/static/116110398200942205911421/

在shell中,文件描述符通常是:STDIN标准输入,STDOUT标准输出,STDERR标准错误输出,即:0,1,2,

例子:nohup abc.sh > nohup.log 2>&1 &

其中2>&1  指将STDERR重定向到前面标准输出定向到的同名文件中,即&1就是nohup.log

那么结果就是当执行的命令发生标准错误,那么这个错误也会输出到你指定的输出文件中 

nohup把abc.sh的输出重定向到文件nohup.log 同时出现错误也输出到nohup.log ,然后后台执行。 There are two formats for redirecting standard output and standard error: &>word and >&word Of the two forms, the first is preferred. This is semantically equivalent to >word 2>&1

转载请注明原文地址: https://www.6miu.com/read-35766.html

最新回复(0)