apt install coreutils -y # ubuntu 安装 nohup
nohup sh test.sh > /root/testsh.log 2>&1 &
# 后台运行
ps -ef | grep test.sh | grep -v grep
# 查看运行的任务
pid=`ps -ef | grep test.sh | grep -v grep| awk -F" " '{print $2}'` && kill -9 $pid
关闭进程
systemd 系统进程编写,linux 开机启动服务编写 systemd 系统服务:http://eisc.cn/index.php?c=read&id=1051&page=1
Powered by ddoss.cn 12.0
©2015 - 2025 ddoss
渝公网安备50011302222260号
渝ICP备2024035333号
【实验平台安全承诺书】
小绿叶技术社区,优化网络中,点击查看配置信息
主机监控系统: 安全防火墙已开启检查cc攻击-下载文件完成后等待10s 恢复访问,检查连接数低于峰值恢复访问
您的IP:216.73.216.110,2025-12-01 16:08:24,Processed in 0.01133 second(s).