SCREEN安裝使用說明

lusklusklusk發表於2017-03-29

安裝
Root#yum –y install screen

使用
script /dev/null
screen

檢視screenscreen –ls

screen –ls只能看到自己使用者下的pts,如root只能看到root使用者的,看不到oracle使用者的


進入某個screenscreen –r screen_pid

離開某個screen:按住CTRL鍵後先後按a和d

某個screen_pid裡面的命令執行完了之後如何退出某個screen_pid

Screen –r screen_pid後直接exit就可以了(crtl+a+d是保留這個screen_pid




下例顯示當前有兩個處於detached狀態的screen會話,你可以使用screen -r <screen_pid>重新連線上:

[root@tivf18 root]# screen –ls

There are screens on:

        8736.pts-1.tivf18       (Detached)

        8462.pts-0.tivf18       (Detached)

[root@tivf18 root]# screen –r 8736

如果由於某種原因其中一個會話死掉了(例如人為殺掉該會話),這時screen -ls會顯示該會話為dead狀態。使用screen -wipe命令清除該會話:

[root@tivf18 root]# kill -9 8462

[root@tivf18 root]# screen -ls 

There are screens on:

        8736.pts-1.tivf18       (Detached)

        8462.pts-0.tivf18       (Dead ???)

[root@tivf18 root]# screen -wipe

There are screens on:

        8736.pts-1.tivf18       (Detached)

        8462.pts-0.tivf18       (Removed)

[root@tivf18 root]# screen -ls 

There is a screen on:

        8736.pts-1.tivf18       (Detached)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2136232/,如需轉載,請註明出處,否則將追究法律責任。

相關文章