我有些关于nohup的问题。下面显示了我尝试过的命令和结果。如果我必须使用nohup ... & ,然后使用disown**,,那么** nohup**?**的用途是什么,我可以简单地使用... &,然后使用disown。
使用nohup 运行命令,然后使用ctr+c运行命令,命令没有继续
$ nohup somecommand -option inputfile > outputfile
nohup: ignoring input and appending output to `nohup.out'
^C使用nohup ... & 和ctr+c运行命令,命令继续,但在退出后停止。
$ nohup somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ exit使用nohup ... & 运行命令,然后使用ctr+c运行命令,即使在退出之后,该命令仍然继续。
$ nohup somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ disown
$ exit使用不带nohup 和ctr+c的运行命令,即使在退出之后,该命令仍会继续。
$ somecommand -option inputfile > outputfile &
nohup: ignoring input and appending output to `nohup.out'
^C
$ disown
$ exit发布于 2013-09-13 10:56:47
确保您使用nohup和&重定向stdout和stderr。
nohup somecommand -option inputfile > outputfile 2>&1 &
exit命令仍在运行.
https://stackoverflow.com/questions/18784261
复制相似问题