  
TA的每日心情 | 郁闷 前天 00:24 |
---|
签到天数: 1669 天 [LV.Master]伴坛终老
|
在CentOS 7上使用screen命令将程序放到后台运行,你需要执行以下步骤:
安装screen:
sudo yum install screen
创建一个新的screen会话:
screen
运行你想要在后台运行的程序,例如:
your_command_here
分离screen会话,按下Ctrl + A然后按下D键。
要查看当前运行的screen会话列表:
screen -ls
要恢复到一个screen会话:
screen -r [会话ID或者名字]
如果你想要在后台直接运行一个程序并确保它不会被挂断,可以使用nohup命令与screen结合使用:
nohup your_command_here &
这样,即使你退出SSH会话,程序也会继续运行。
|
|