本文均为挪用他人内容,并非原创
Linux——让程序在后台运行(四种方法+使用推荐)_linux 后台运行-优快云博客
---------------------------------------------------------------------------------------------------------------------------------
1、“&”符号
# 执行文件 ./test.py & # 查看是否在后台运行 ps -ef|grep test
# 后台的程序 需要关闭时,需要kill命令停止
killall [程序名]
注意:这种方法,查看运行日志很不方便(不推荐)
2. nohup命令
nohup python test.py > test.log 2>&1 &
&: 是一个描