Cool
Cool
Published on 2021-11-11 / 29 Visits
0
0

nohup 使用

语法格式

nohup Command [ Arg … ] [ & ]

{card-default label="参数说明:" width=""} Command:要执行的命令。 Arg:一些参数,可以指定输出文件。 &:让命令在后台执行,终端退出后命令仍旧执行。

{/card-default}

nohup java-jar a.jar > mylog.log 2>&1 &

{card-default label="2>&1 解释:" width=""} 将标准错误 2 重定向到标准输出 &1 ,标准输出 &1 再被重定向输入到 runoob.log 文件中。

0 – stdin (standard input,标准输入) 1 – stdout (standard output,标准输出) 2 – stderr (standard error,标准错误输出) {/card-default}


Comment