nohup作为后台任务不返回提示

时间:2014-04-12 01:04:35

标签: nohup

我试图在后台运行一个长时间运行的任务,而不必登录并让终端返回提示,但是当我这样做时,任务似乎进入后台,但我的提示不会变为除非我点击控制+ c,否则可用。我想运行任务,然后回复我的提示。

[staging@php-pos-web ~]$ nohup php test.php > test.txt &
[1] 27251
[staging@php-pos-web ~]$ nohup: ignoring input and redirecting stderr to stdout

1 个答案:

答案 0 :(得分:14)

您应该提示您的提示,因为您的命令将被发送到后台。您可能没有看到提示,因为您的命令仍在向控制台发送stderr消息。尝试使用> test.txt 2>&1 </dev/null &