[20191217]Linux screen Command學習筆記.txt

lfree發表於2019-12-17

[20191217]Linux screen Command學習筆記.txt

--//很少使用Screen命令,不過有時候有一些伺服器沒有安裝tmux,需要這類的軟體協同工作.自己並不想仔細學習.
--//僅僅瞭解基本使用就ok了.
--//基本操作鍵如下,實際上有點跟tmux相似.估計tmux開始也是借鑑screen的一些操作鍵.

Ctrl-a followed by c: create a new windows
Ctrl-a followed by w: display the list of all the windows currently opened
Ctrl-a followed by A: rename the current windows. The name will appear when you will list the list of windows opened with Ctrl-a followed by w.
Ctrl-a followed by n: go to the next windows
Ctrl-a followed by p: go to the previous windows
Ctrl-a followed by Ctrl-a: back to the last windows used.
Ctrl-a followed by a number from 0 to X: go the windows n° X.
Ctrl-a followed by ": choose the windows into which to move on. "
Ctrl-a followed by k: close the current windows (kill)
Ctrl-a followed by S: split the current windows horizontally. To switch between the windows, do Ctrl-a followed by Tab.
Ctrl-a followed by |: split the current windows vertically
Ctrl-a followed by d: detach a screen session without stopping it
Ctrl-a followed by r: reattach a detached screen session
Ctrl-a followed by [: start the copy mode
Ctrl-a followed by ]: paste the copied texte

1.啟動screen:
--//sesson 1:
$ screen

--//session 2:
# screen -ls
There is a screen on:
        8848.pts-0.hisdg        (Attached)
1 Socket in /tmp/screens/S-root.

--//session 2:
$ screen -d 8848

--//sesson 1會提示:
[remote detached]
--//這時連線detached.

# screen -ls
There is a screen on:
        8848.pts-0.hisdg        (Detached)
1 Socket in /tmp/screens/S-root.

--//使用如下命令連線attach上.
$ screen -r 8848

--//如果僅僅1個screen,可以screen -d退出,screen -r連上.
--//還有一種方式給screen 一個名字:screen -S test

# screen -S test
# screen -ls
There is a screen on:
        9190.test       (Attached)
1 Socket in /tmp/screens/S-root.

2.如何共享會話:
# screen -x test

--//知道這些就足夠了.

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

相關文章