nohup
命令的默认输出文件是 nohup.out
。当你在 Linux 或 Unix 系统中使用 nohup
命令运行一个程序时,该程序的标准输出(stdout)和标准错误(stderr)会被重定向到这个文件中。这样,即使你关闭终端或断开连接,程序仍然会继续运行,并且输出信息会被保存在 nohup.out
文件中。
例如,如果你运行以下命令:
nohup my_command &
my_command
的输出将被重定向到 nohup.out
文件中。如果你想将输出重定向到其他文件,可以使用以下命令:
nohup my_command > output.log 2>&1 &
这将把标准输出和标准错误都重定向到 output.log
文件中。