创建屏幕
$ screen -S JohnRain
查看现有屏幕列表
$ screen -list
注: 不同用户有不同的屏幕列表
恢复屏幕
$ screen -r JohnRain
注:
使用su从别的用户跳转到当前用户,需要先运行script /dev/null
, 再恢复屏幕,否则会有以下错误:
Cannot open your terminal '/dev/pts/0' - please check.
断开屏幕
先按Ctrl+a
,再按Ctrl+d
中断一个attached状态的屏幕
如果一个屏幕已经被连接了,其他的终端是连接不了的,需要先断连屏幕,使用下面命令:
screen -d JohnRain