是的,在 CentOS 中,nohup 命令可以指定输出文件
nohup
nohup command > output.log 2>&1 &
在这个示例中,command 是你要执行的命令,output.log 是你要将输出重定向到的文件。2>&1 表示将错误输出(标准错误)重定向到标准输出,& 表示在后台运行命令。这样,即使你关闭终端,命令也会继续运行,输出将被追加到 output.log 文件中。
command
output.log
2>&1
&