nohup,不挂断地运行命令。
nohup运行由 Command参数和任何相关的 Arg参数指定的命令,忽略所有挂断(SIGHUP)信号;
用法:
nohup COMMAND [ARG]...
or: nohup OPTION
忽略所有挂断(SIGHUP)信号
--help
--version
If standard input is a terminal, redirect it from /dev/null.
If standard output is a terminal, append output to `nohup.out‘ if possible,
`$HOME/nohup.out‘ otherwise.
If standard error is a terminal, redirect it to standard output.
To save output to FILE, use `nohup COMMAND > FILE‘.
0 – stdin (standard input),1 – stdout (standard output),2 – stderr (standard error) ;
& : 指在后台运行
nohup : 不挂断的运行,注意并没有后台运行的功能,,就是指,用nohup运行命令可以使命令永久的执行下去,和用户终端没有关系,例如我们断开SSH连接都不会影响他的运行,注意了nohup没有后台运行的意思;&才是后台运行
&是指在后台运行,但当用户推出(挂起)的时候,命令自动也跟着退出
原文:https://www.cnblogs.com/zhco/p/11281682.html