LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 854|回复: 2

linux控制台下的“多窗口”程序screen扫盲(转)

[复制链接]
发表于 2006-8-11 18:13:29 | 显示全部楼层 |阅读模式
今天搜到一篇讲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
发表于 2006-8-11 20:30:59 | 显示全部楼层
这些命令是 这个SCREEN 程序专用的吧?

我用的KDE 带的KCONSOLE 也可以多窗口..
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-14 17:52:51 | 显示全部楼层

这些命令应该是screen程序专用的吧?

我在X的 gnome-terminal试了一下,screen可以使用,但是没有在kconsole下试,估计可以运行吧?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表