使用nohup命令
nohup
nohup 命令
用途:LINUX命令用法,不挂断地运行命令。
语法:nohup Command [ Arg ... ] [ & ]
描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断(SIGHUP)信号。在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 & ( 表示“and”的符号)到命令的尾部。
[root@MyCloudServer src]# ls
app appmain.py config.json nohup.out startmaster.py tool
[root@MyCloudServer src]# nohup python startmaster.py &
[1] 22103
[root@MyCloudServer src]# nohup: appending output to `nohup.out'
已成功使python程序在Linux下一直运行。

本文介绍了如何使用nohup命令在Linux环境下使程序在后台持续运行。通过具体的实例演示了如何利用nohup命令启动Python程序,并让其忽略挂断信号继续运行。
16万+

被折叠的 条评论
为什么被折叠?



