|
|
今天搜到一篇讲screen用法的英文帖子,感觉很不错,摘一段关键的转载于此。
转自http://gentoo-wiki.com/TIP_Using_screen
在图形界面下,一个桌面可以有许多窗口,在控制台下也可以实现。
命令简介:
Quick walk-through
Command Effect
screen Login and start a Screen session right away
C-a " Show list of terminals managed by Screen; Here: only one
Esc Close the list window
C-a c Create a new terminal window
C-a " The list of terminals now shows two entries
Esc Close the list window
ls show the directory contents in this window
C-a p return to the previous, first window
ping forums.gentoo.org Do something in this window, too
C-a c Create another window
C-a S Split the term vertically into two regions
C-a X Kill the current region
C-a <Tab> Focus the newly created region
C-a - Resize this region and make it 3 lines smaller
C-a 1 Show the first window in this region
C-a <Tab> Move the focus back to the upper region
C-a d Detach the Screen session
open a xterm
screen -DR login again and make Screen re-attach (R) to the first session found, after detaching (D) the session
first, if necessary (which it wasn't)
下面还有动画演示。
Seeing is believing
An animation of Screen's usage
Enlarge
An animation of Screen's usage
This animated .gif shows most basic commands in a sequence of 50 pictures. This is a transcript of all typed keystrokes:
xterm<Enter>
screen<Enter>
C-a "
<Esc>
C-a c
C-a "
<Esc>
ping forums.gentoo.org<Enter>
C-a n
ls -la<Enter>
C-a S
C-a <Tab>
C-a 1
C-a <Tab>
C-a +
C-a :resize 18<Enter>
C-a x
password
C-a d
screen -ls<Enter>
screen -R<Enter>
printf 'GET / HTTP/1.0\n\n' | telnet forums.gentoo.org 80<Enter>
C-a <Esc>
< ageUp>
<ArrowKeys>
<Space>
<ArrowKeys>
<Space>
C-a c
lynx C-a ]

Exiting Screen
One way to close a Screen session is to exit all terminal sessions you are running inside, one after the other. After the last exit inside Screen you will get [screen is terminating] as a confirmation that your Screen session has ended.
However, a simpler and faster way to do the same thing is to use Screen's quit command.
C-a :quit
This will kill all programs running inside the current Screen session and exit the session. If you use this command frequently, it may be useful to create a keybinding in your configuration file:
File: ~/.screenrc
# bind F10 to Screen's quit command
bindkey -k k; quit
See the "INPUT TRANSLATION" section of the Screen manual for details on how to bind function keys (e.g, F1, F2, ...).
全文请见原文: http://gentoo-wiki.com/TIP_Using_screen |
|