首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在我通过ssh进行nohup时,ctr+c之后会发生什么?

在我通过ssh进行nohup时,ctr+c之后会发生什么?
EN

Stack Overflow用户
提问于 2013-09-13 10:37:33
回答 1查看 518关注 0票数 3

我有些关于nohup的问题。下面显示了我尝试过的命令和结果。如果我必须使用nohup ... & ,然后使用disown**,,那么** nohup**?**的用途是什么,我可以简单地使用... &,然后使用disown

使用nohup 运行命令,然后使用ctr+c运行命令,命令没有继续

代码语言:javascript
运行
复制
$ nohup somecommand -option inputfile > outputfile
nohup: ignoring input and appending output to `nohup.out'
^C

使用nohup ... & 和ctr+c运行命令,命令继续,但在退出后停止。

代码语言:javascript
运行
复制
$ nohup somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ exit

使用nohup ... & 运行命令,然后使用ctr+c运行命令,即使在退出之后,该命令仍然继续。

代码语言:javascript
运行
复制
$ nohup somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ disown
$ exit

使用不带nohup 和ctr+c的运行命令,即使在退出之后,该命令仍会继续。

代码语言:javascript
运行
复制
$ somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ disown
$ exit
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-13 10:56:47

确保您使用nohup&重定向stdout和stderr。

代码语言:javascript
运行
复制
nohup somecommand -option inputfile > outputfile 2>&1 &
exit

命令仍在运行.

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18784261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档