nohup命令
nohup是Linux和Unix系统中的一个命令,其作用是在终端退出时,让进程在后台继续运行。它的全称为"no hang up",意为"不挂起"。nohup命令可以让你在退出终端或关闭SSH连接后继续运行命令。
nohup 命令,在默认情况下(非重定向时),会输出一个名叫 nohup.out 的文件到当前目录下,如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。
著者
由Jim Meyering撰写。
语法
nohup 命令 [参数]...
nohup 选项
nohup命令 -Linux手册页
选项及作用
执行令 : nohup --help
执行命令结果

常用命令示例
命令:nohup test5.sh &
以下命令在后台执行 test5.sh 脚本。

命令:nohup test5.sh > test5_5.txt &
标准输出重定向到test5_5.txt 文件。

命令:nohup test5.sh >/dev/null 2>&1
/dev/null文件是一个无底洞,任何东西都可以定向到这里,但是却无法打开。

