我试图在后台运行长时间运行的任务,而无需再进行登录,并在终端返回一个提示,但我这样做的时候,任务似乎进入到了后台,但我的提示不变得可用,除非我命中控制+ 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
Run Code Online (Sandbox Code Playgroud)
Dev*_*von 18
您应该提示您的提示,因为您的命令将被发送到后台.您可能没有看到提示,因为您的命令仍在向控制台发送stderr消息.尝试使用> test.txt 2>&1 </dev/null &.