您的位置:首页 > 理论基础 > 计算机网络

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

2017-07-10 18:28 218 查看
 


nohup 输出重定向

2015-10-20 12:25 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐