nohup: ignoring input and appending output to ‘nohup.out’怎么解决
时间: 2024-05-31 10:06:14 浏览: 26
nohup是一个命令,它可以让你在退出终端或者注销账户后仍能使命令继续运行。而“ignoring input and appending output to 'nohup.out'”则是nohup命令的一种输出结果,它表示nohup命令将忽略输入并将输出追加到名为“nohup.out”的文件中。
如果你想要更改输出文件的名称,可以在nohup命令后面加上文件名,例如:
```
nohup command > output.file 2>&1 &
```
这个命令将会把命令的输出保存到名为“output.file”的文件中。
如果你想要停止nohup命令的运行,可以使用以下命令:
```
ps -ef | grep nohup
```
这个命令将会显示所有正在运行的nohup进程的信息。找到你想要停止的进程的PID,然后使用kill命令停止它的运行,例如:
```
kill PID
```
请注意,这里的“PID”是指你想要停止的进程的ID号码。
相关问题
nohup: ignoring input and appending output to 'nohup.out
nohup: ignoring input and appending output to 'nohup.out’这个错误信息表示在使用nohup命令时,输入被忽略并且输出被追加到nohup.out文件中。nohup命令用于在系统后台运行命令,即使你退出终端,程序仍然会继续运行。默认情况下,nohup命令会将输出信息重定向到一个名为nohup.out的文件中,如果当前目录下的nohup.out文件不可写,则会将输出重定向到$HOME/nohup.out文件中。
出现这个错误的原因是在运行nohup命令时没有在命令的末尾添加&符号,导致命令没有在后台运行。解决方法是在需要在后台运行的nohup命令的末尾添加&符号,这样就不会出现该错误了。
nohup: ignoring input and appending output to 'nohup.out'
当使用nohup命令运行一个程序时,出现"nohup: ignoring input and appending output to 'nohup.out'"的提示,这通常是由于输出缓冲的原因导致的。为了解决这个问题,可以在运行命令时加上"-u"选项,例如"nohup python -u Bilstm-My-Exp-Char.py --train"。这样可以禁用输出缓冲,实时地将输出写入文件,避免了出现上述提示信息。
此外,还可以解释一下这个提示中的一些相关内容。其中,"nohup"是一个命令,放在命令开头表示不挂起,即使退出终端该进程也不会停止运行。而"&"符号放在命令结尾,表示将该命令在后台运行。而"nohup.out"是一个输出文件,用于保存程序的输出内容。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [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* [解决nohup重定向python输出到文件不成功的问题](https://download.csdn.net/download/weixin_38732252/13773149)[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 ]