用途:不挂断地运行命令
语法:nohup Command [ Arg … ] [&]
操作系统三个常用的流:
0:标准输入流 stdin
1:标准输出流 stdout
2:标准错误流 stderr
示例:
nohup java -jar platform-1.0-SNAPSHOT.jar 1> platform.out 2>&1 &
#不想要输出信息>/dev/null 2>&1
nohup java -jar platform-1.0-SNAPSHOT.jar >/dev/null 2>&1 &
解析
1> platform.out 标准输出到文件platform.out
2>&1:标准错误[2]重定向到标准输出中[1]
&:后台运行