我试图在后台运行一个长时间运行的任务,而无需登录并让终端返回提示,但是当我这样做时,该任务似乎进入后台,但我的提示不可用,除非我按 Control + 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
您应该有可用的提示,因为您的命令将被发送到后台。您可能看不到提示符,因为您的命令仍在向控制台传送 stderr 消息。尝试使用> test.txt 2>&1 </dev/null &
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)