报错ignoring input and appending output to 'nohup.out'
时间: 2023-12-08 12:38:39 浏览: 70
这个错误是因为nohup命令忽略了输入并将输出附加到nohup.out文件中。这通常是因为你在使用nohup命令时没有正确地指定输入和输出文件。你可以通过以下两种方法来解决这个问题:
1.指定输入和输出文件:
```shell
nohup command > output.file 2>&1 < /dev/null &
```
其中,command是你要运行的命令,output.file是你要将输出写入的文件名。2>&1将标准错误输出重定向到标准输出,/dev/null将标准输入重定向到空设备,&将命令放入后台运行。
2.使用screen命令:
```shell
screen -S session_name
command
```
其中,session_name是你要创建的会话名称,command是你要运行的命令。这将创建一个新的会话并在其中运行命令。你可以使用Ctrl+A D将会话分离并在后台运行,使用screen -r session_name重新连接到会话。
相关问题
ignoring input and appending output to 'nohup.out'
"ignoring input and appending output to 'nohup.out'"是nohup命令的标准输出。当使用nohup命令时,如果忽略输入并将输出追加到'nohup.out'文件中,就会显示这个信息。 为了解决这个问题,可以在命令开头加上nohup,表示不挂起,并且即使退出终端,该进程也不会停止运行。另外,
#### 引用[.reference_title]
- *1* [nohup: ignoring input and appending output to `nohup.out](https://blog.csdn.net/qq_39341318/article/details/116154413)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [nohup: ignoring input and appending output to ‘nohup.out](https://blog.csdn.net/qq_51066068/article/details/124542326)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
ignoring input and appending output to ‘nohup.out’
"ignoring input and appending output to 'nohup.out'" 是nohup命令执行时的提示信息,表示将输入忽略,并将输出追加到"nohup.out"文件中。 这样做的目的是在终端退出后,仍然能够继续运行并记录输出信息。
解决这个问题的方法是在命令开头使用nohup,表示不挂起进程,并在命令结尾使用"&"将其放入后台运行。这样即使退出终端,该进程也不会被中断,并且输出会被追加到"nohup.out"文件中。 这样可以确保你的命令在后台持续运行,同时也能够查看命令的输出。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [nohup: ignoring input and appending output to `nohup.out](https://blog.csdn.net/qq_39341318/article/details/116154413)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [nohup: ignoring input and appending output to ‘nohup.out](https://blog.csdn.net/qq_51066068/article/details/124542326)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]