nohup /root/run.sh &# &:让命令在后台执行,终端退出后命令仍旧执行 如果要停止运行,使用kill -9 PID 来停止运行,用ps来找出PID ps -aux | grep "/root/run.sh"