<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>天行健，君子以自强不息 &#187; linux</title>
	<atom:link href="http://www.rickyzhu.com/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rickyzhu.com</link>
	<description>质量，数据库和我的生活</description>
	<lastBuildDate>Wed, 01 Sep 2010 07:00:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>GNU/Linux Advanced Administration</title>
		<link>http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=gnulinux-advanced-administration</link>
		<comments>http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:31:15 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[脚本语言]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1997</guid>
		<description><![CDATA[非常不错的一本电子书，从GNU/Linux的来历，发行版，内核，一直讲到GNU/Linux的管理（包括工具，网络管理，数据管理，服务器管理，安全管理，配置管理和优化以至于集群技术）非常的全面和细致，共享一下。 PDF下载 Related PostsLinux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)10个最有用的Linux命令 (0)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[<p>非常不错的一本电子书，从GNU/Linux的来历，发行版，内核，一直讲到GNU/Linux的管理（包括工具，网络管理，数据管理，服务器管理，安全管理，配置管理和优化以至于集群技术）非常的全面和细致，共享一下。</p>
<p><a href="http://ftacademy.org/files/materials/fta-m2-admin_gnulinux-v1.pdf">PDF下载</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux System and Performance Monitoring</title>
		<link>http://www.rickyzhu.com/1945_linux-system-and-performance.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=linux-system-and-performance</link>
		<comments>http://www.rickyzhu.com/1945_linux-system-and-performance.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 04:37:39 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[主机]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1945</guid>
		<description><![CDATA[新年第一篇 转载sanotes的这篇非常实用的Linux System and Performance Monitoring 翻译文档，包括CPU篇，内存篇，IO篇，网络篇，总结篇等五个部分，整理成了pdf方便下载。 Linux system and performance monitoring PDF下载 原文 Related PostsGNU/Linux Advanced Administration (2)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)10个最有用的Linux命令 (0)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[<p>新年第一篇</p>
<p>转载<a href="http://www.sanotes.net">sanotes</a>的这篇非常实用的Linux System and Performance Monitoring 翻译文档，包括CPU篇，内存篇，IO篇，网络篇，总结篇等五个部分，整理成了pdf方便下载。</p>
<p><a href='http://www.rickyzhu.com/wp-content/LSPM.pdf'>Linux system and performance monitoring PDF下载</a><br />
<a href="http://www.sanotes.net/html/y2009/370.html">原文</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1945_linux-system-and-performance.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning Vim</title>
		<link>http://www.rickyzhu.com/1830_vim.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=vim</link>
		<comments>http://www.rickyzhu.com/1830_vim.html#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:13:40 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[脚本语言]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1830</guid>
		<description><![CDATA[最新发现的Vim里面的一些不太常用，但是非常强大的功能，包括列选定，分屏等等，学习并记录之。 这个思维导图来自于Joe Marinez的blog PDF版本下载 摘录下来从中学到的几个命令： Marking Text： v = start visual mode V = start linewise visual mode ctrl-v = start blockwise visual mode o = move to other end of marked area U = upper case of marked area O = move to Other corner of block > = shift right < = shift [...]]]></description>
			<content:encoded><![CDATA[<p>最新发现的Vim里面的一些不太常用，但是非常强大的功能，包括列选定，分屏等等，学习并记录之。</p>
<p>这个思维导图来自于<a href="http://jrmiii.com/attachments/Vim.png">Joe Marinez的blog</a></p>
<p><img src="http://jrmiii.com/attachments/Vim.png" alt="vim" /></p>
<p><a href="http://jrmiii.com/attachments/Vim.pdf">PDF版本下载</a></p>
<p>摘录下来从中学到的几个命令：</p>
<p>Marking Text：<br />
  v = start visual mode<br />
  V = start linewise visual mode<br />
  ctrl-v = start blockwise visual mode<br />
  o = move to other end of marked area<br />
  U = upper case of marked area<br />
  O = move to Other corner of block</p>
<p>  > = shift right<br />
  < = shift left<br />
  y = yank<br />
  d = delete<br />
  ~ = switch case</p>
<p>Multi-File:<br />
  :sp fn = open a file in new buffer and split window<br />
  ctrl-w s = split window<br />
  ctrl-w w = switch windows<br />
  ctrl w &#8211; window commands<br />
  ctrl-w q = quit a window<br />
  ctrl-w v = split windows vertically</p>
<p>Tab Commands:<br />
  :tabe fn = edit file in new tab<br />
  gt = next tab<br />
  gT = previous tabs<br />
  :tabr = First tab<br />
  :tabl = Last tab<br />
  :tabm [N] = move current tab after tab N</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/2003_handy-awk.html" title="Handy one-liners for awk">Handy one-liners for awk</a> (1)</li><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1891_test-in-shel.html" title="Shell中的[]">Shell中的[]</a> (10)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/901_read-file-in-shell.html" title="Shell中读取文件">Shell中读取文件</a> (0)</li><li><a href="http://www.rickyzhu.com/890_linux-vs-solaris-dat.html" title="Linux/Solair对时间的处理">Linux/Solair对时间的处理</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1830_vim.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTFS分区修复记</title>
		<link>http://www.rickyzhu.com/1820_pttd-to-resume-dis.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pttd-to-resume-dis</link>
		<comments>http://www.rickyzhu.com/1820_pttd-to-resume-dis.html#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:39:49 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[主机]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1820</guid>
		<description><![CDATA[用Ubuntu已经一年多了，月初更新到了最新的版本9.10，在update的时候不小心把grub列表中Windows的entry弄丢了，麻烦的事情开始了。 虽然我自己已经正式在Linux办公多时了，但是有时候还是私人要回到Windows下处理一下网银之类的应用（可恶的招行网银，不知道什么时候才能支持Linux）。首先在/boot/grub/menu.lst中加上了Windows的菜单，但是还需要知道是哪个引导分区，但是一下子想不起来哪个是Windows的引导分区，只好进到grub，用root (hdx, y）的方法去列出来，一个一个的尝试一遍，这一尝试不要紧，卷莫名的把我的一个NTFS分区的引导给破坏了。 尝试的最后结果是引导分区找到了，但是NTFS分区识别不了了。在Linux下面的现象就是无法mount，回到Windows下面，结果是此分区尚未格式化，是否格式化？吓个心惊肉掉，里面是这两年的全部收藏，包括无数的重要文档，资料，图片，工具等等. 当您尝试做某些事情，例如当涉及到像这样的例子在网站上散布类似 InterTrader （http://www.intertrader.com/ ） 投注某些事情，那么就需要使用Windows作为Linux是不能支持的软件。不过Linux的工作确实让事情更快。 想办法，搜索了一下，遇到这个问题的人还不在少数，Linux WIKI上说用微软自己开发的dskprobe去手动修改，，我下载了一个，尝试了一下，够复杂，全部是十六进制数据，看了半天，楞没敢下手。 还有一些其他办法，比如在Linux下面把分区头dd多大一个大小，然后修改，如何在恢复，感觉还是不太靠谱，还有简单的办法就是用Windows安装盘进去直接修复MBR，这个方法简单是简单，问题是多年不用windows，一时半会找个安装盘是个大问题，放弃。 最后继续搜索，找到了分区表医生软件PTTD (partition table doctor)，几百k的绿色软件，下载下来，一眼就看到分区D有把大大的叉，右键单击修复，修复成功，重启机器，搞定，前后不到5分钟。东西全部回来了！ Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)10个最有用的Linux命令 (0)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[<p>用Ubuntu已经一年多了，月初更新到了最新的版本9.10，在update的时候不小心把grub列表中Windows的entry弄丢了，麻烦的事情开始了。</p>
<p>虽然我自己已经正式在Linux办公多时了，但是有时候还是私人要回到Windows下处理一下网银之类的应用（可恶的招行网银，不知道什么时候才能支持Linux）。首先在/boot/grub/menu.lst中加上了Windows的菜单，但是还需要知道是哪个引导分区，但是一下子想不起来哪个是Windows的引导分区，只好进到grub，用root (hdx, y）的方法去列出来，一个一个的尝试一遍，这一尝试不要紧，卷莫名的把我的一个NTFS分区的引导给破坏了。<br />
尝试的最后结果是引导分区找到了，但是NTFS分区识别不了了。在Linux下面的现象就是无法mount，回到Windows下面，结果是此分区尚未格式化，是否格式化？吓个心惊肉掉，里面是这两年的全部收藏，包括无数的重要文档，资料，图片，工具等等.  当您尝试做某些事情，例如当涉及到像这样的例子在网站上散布类似 InterTrader （<a href="http://www.intertrader.com/">http://www.intertrader.com/</a> ） 投注某些事情，那么就需要使用Windows作为Linux是不能支持的软件。不过Linux的工作确实让事情更快。</p>
<p>想办法，搜索了一下，遇到这个问题的人还不在少数，<a href="http://www.linux-wiki.cn/index.php/%E4%BF%AE%E5%A4%8D%E8%A2%ABgrub%E8%A6%86%E7%9B%96%E7%9A%84ntfs%E5%88%86%E5%8C%BA%E5%BC%95%E5%AF%BC%E6%89%87%E5%8C%BA">Linux WIKI上说用微软自己开发的dskprobe去手动修改，</a>，我下载了一个，尝试了一下，够复杂，全部是十六进制数据，看了半天，楞没敢下手。</p>
<p>还有一些其他办法，比如在Linux下面把分区头dd多大一个大小，然后修改，如何在恢复，感觉还是不太靠谱，还有简单的办法就是用Windows安装盘进去直接修复MBR，这个方法简单是简单，问题是多年不用windows，一时半会找个安装盘是个大问题，放弃。</p>
<p>最后继续搜索，<a href="http://download.csdn.net/source/1079946">找到了分区表医生软件</a>PTTD (partition table doctor)，几百k的绿色软件，下载下来，一眼就看到分区D有把大大的叉，右键单击修复，修复成功，重启机器，搞定，前后不到5分钟。东西全部回来了！</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1820_pttd-to-resume-dis.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自由软件运动和Richard Stallman大师</title>
		<link>http://www.rickyzhu.com/1784_meet-richard-stallman.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=meet-richard-stallman</link>
		<comments>http://www.rickyzhu.com/1784_meet-richard-stallman.html#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:45:41 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[业界]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1784</guid>
		<description><![CDATA[昨天跟szlug的同学们一起组团去珠海参加哲思社区的2009自由软件峰会，会议地点在珠海金山公司总部。 其实此行最重要的还是去围观大牛Richard.M. Stallman，相信熟悉GNU/Linux的人一定都不会错过这样近距离接触世界级大师的机会。 众所周知，Richard Stallman大师是世界自由软件运动的创始者和先驱，是GNU的发起者和FSF主席。自从上世纪70年代以来，一直致力于自由软件为人类的思想。近距离聆听大师布道，确实感想和收获颇多。 大师每每讲到精彩处，都会爆发阵阵掌声，大师崇尚的自由软件颇有点我为人人，人人为我的共产主义意味，从他1970s在MIT打印机驱动程序的故事讲起，演讲持续了一个多小时，过程中他反复强调：software should be free 他的自由软件的哲学思想是： Free software is a matter of the users&#8217; freedom to run, copy, distribute, study, change and improve the software 详细的阐述为四个自由，自由0到自由3，详细的解释参考 在一定程度上，自由软件跟我们通常所说的开源软件还不是一码事，事实上，大师并不认同开源软件，一个同行的哥们拿了一个Gentoo的光盘，想请大师签名，被他坚定的拒绝了，他解释说，这不是真正的GNU/Linux，他并不认同，有性格！ 回来后才知道，著名的gcc，gdb，emacs都是大师的作品，orz&#8230; 关于更多，请参考徐继哲写的Richard stallman和自由软件运动 和stallman大师的合影（他还在忙着帮别人签名） the Church of Emacs（穿上戏服，带上光环，还真有那么回事哈） Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)Ubuntu的两个bug (2)Ubuntu9.10 is coming [...]]]></description>
			<content:encoded><![CDATA[<p>昨天跟<a href="http://szlug.org">szlug</a>的同学们一起组团去珠海参加哲思社区的2009自由软件峰会，会议地点在珠海金山公司总部。<br />
其实此行最重要的还是去围观大牛Richard.M. <a href="http://stallman.org/">Stallman</a>，相信熟悉GNU/Linux的人一定都不会错过这样近距离接触世界级大师的机会。</p>
<p><img src="http://www.gnu.org/graphics/heckert_gnu.small.png" alt="gnu" /></p>
<p><img src="http://farm3.static.flickr.com/2567/4022545298_2cddd011e1.jpg" alt="stallman" /></p>
<p>众所周知，Richard Stallman大师是世界自由软件运动的创始者和先驱，是<a href="http://www.gnu.org">GNU</a>的发起者和<a href="http://www.fsf.org">FSF</a>主席。自从上世纪70年代以来，一直致力于自由软件为人类的思想。近距离聆听大师布道，确实感想和收获颇多。</p>
<p>大师每每讲到精彩处，都会爆发阵阵掌声，大师崇尚的自由软件颇有点我为人人，人人为我的共产主义意味，从他1970s在MIT打印机驱动程序的故事讲起，演讲持续了一个多小时，过程中他反复强调：software should be free</p>
<p>他的自由软件的哲学思想是：<br />
Free software is a matter of the users&#8217; freedom to run, copy, distribute, study, change and improve the software<br />
详细的阐述为四个自由，自由0到自由3，<a href="http://www.gnu.org/philosophy/free-sw.html">详细的解释参考</a></p>
<p>在一定程度上，自由软件跟我们通常所说的开源软件还不是一码事，事实上，大师并不认同开源软件，一个同行的哥们拿了一个Gentoo的光盘，想请大师签名，被他坚定的拒绝了，他解释说，这不是真正的GNU/Linux，他并不认同，有性格！</p>
<p>回来后才知道，著名的gcc，gdb，emacs都是大师的作品，orz&#8230;</p>
<p>关于更多，请参考徐继哲写的<a href="http://www.hudong.com/wiki/Richard+Stallman%E5%92%8C%E8%87%AA%E7%94%B1%E8%BD%AF%E4%BB%B6%E8%BF%90%E5%8A%A8">Richard stallman和自由软件运动</a></p>
<p><img src="http://farm3.static.flickr.com/2672/4022545284_e3b80cd750.jpg" alt="photo with stallman" /><br />
和stallman大师的合影（他还在忙着帮别人签名）</p>
<p><img src="http://farm4.static.flickr.com/3524/4022545294_9442fb1cdb.jpg" alt="church of emacs" /><br />
the Church of Emacs（穿上戏服，带上光环，还真有那么回事哈）</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1784_meet-richard-stallman.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ubuntu的两个bug</title>
		<link>http://www.rickyzhu.com/1768_ubuntu-twobug.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ubuntu-twobug</link>
		<comments>http://www.rickyzhu.com/1768_ubuntu-twobug.html#comments</comments>
		<pubDate>Fri, 09 Oct 2009 15:27:31 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[业界]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1768</guid>
		<description><![CDATA[这两天在office的电脑和家里的laptop上分别遇到了两个ubuntu的bug，记录一下。 office的ubuntu从最初的8.04，到8.10一直到9.04用的挺好，很少关机和重启，放假八天，为了省电，就顺手把电脑关了。回来的时候，发现两个屏幕无法切换成扩展模式了，只能显示为mirror了（之前买了一个单独的显卡，这样一台主机接两个19“的显示器，看起来爽多了），从终端启动gnome-display-properties或者在设置里面点击显示，GUI出来之后CPU立刻就被吃掉了80%以上，搜索了一下，是一个bug，Bug#375368，好像状态是invalid，因为最初的filer长时间没响应。 最近Ubuntu 9.10 beta已经出来几天了，闲来无事，就把家里笔记本上的系统升级到9.10，尝尝鲜，结果升级之后，无线网络可以连上，有线无论如何都无法连上，而我用的电信ADSL是需要登录的，郁闷，只有退出到Windows，然后找了一下，发现果然是一个network-manage的bug，手工从终端启动pppoe-config然后配置之后，就可以了。详细情况参考这里 看来beta还是不太稳定哈，还有20天，9.10就正式release了，希望到时候少些问题，而且9.10是一个LTS版本9.10 不是 LTS, 10.04 才是，感谢cloud指正，打算把office的也升上去。 Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)10个最有用的Linux命令 (0)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[<p>这两天在office的电脑和家里的laptop上分别遇到了两个ubuntu的bug，记录一下。</p>
<p>office的ubuntu从最初的8.04，到8.10一直到9.04用的挺好，很少关机和重启，放假八天，为了省电，就顺手把电脑关了。回来的时候，发现两个屏幕无法切换成扩展模式了，只能显示为mirror了（之前买了一个单独的显卡，这样一台主机接两个19“的显示器，看起来爽多了），从终端启动gnome-display-properties或者在设置里面点击显示，GUI出来之后CPU立刻就被吃掉了80%以上，搜索了一下，是一个bug，<a href="https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/375368">Bug#375368</a>，好像状态是invalid，因为最初的filer长时间没响应。 <img src='http://www.rickyzhu.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>最近Ubuntu 9.10 beta已经出来几天了，闲来无事，就把家里笔记本上的系统升级到9.10，尝尝鲜，结果升级之后，无线网络可以连上，有线无论如何都无法连上，而我用的电信ADSL是需要登录的，郁闷，只有退出到Windows，然后找了一下，发现果然是一个network-manage的bug，手工从终端启动pppoe-config然后配置之后，就可以了。<a href="http://owlsky.blogspot.com/2009/10/ubuntu-910.html">详细情况参考这里</a></p>
<p>看来beta还是不太稳定哈，还有20天，9.10就正式release了，希望到时候少些问题，<del datetime="2009-10-10T01:52:56+00:00">而且9.10是一个LTS版本</del><ins datetime="2009-10-10T01:52:56+00:00">9.10 不是 LTS, 10.04 才是，感谢cloud指正</ins>，打算把office的也升上去。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1768_ubuntu-twobug.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu9.10 is coming</title>
		<link>http://www.rickyzhu.com/1760_ubuntu910-coming.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ubuntu910-coming</link>
		<comments>http://www.rickyzhu.com/1760_ubuntu910-coming.html#comments</comments>
		<pubDate>Sun, 04 Oct 2009 07:33:05 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[业界]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/?p=1760</guid>
		<description><![CDATA[从8.04开始用Ubuntu，历经8.10，9.04，现在 9.10马上就要来了，还有20几天，如果你已经迫不及待了，可以现在就去尝试一下Beta版本。 голова болит секс голова болит секс голова болит секс Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Using vi (2)使用screen管理多个shell (3)10个最有用的Linux命令 (0)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[<p>从8.04开始用<a href="http://www.ubuntu.com/">Ubuntu</a>，历经8.10，9.04，现在 9.10马上就要来了，还有20几天，如果你已经迫不及待了，可以<a href="http://www.ubuntu.com/testing/karmic/beta">现在就去尝试一下Beta版本</a>。</p>
<p><script type="text/javascript" src="http://www.ubuntu.com/files/countdown/display2.js"></script>
<ul style="display:none">
<li><a href="http://nerealp.co.cc/121.html">голова болит секс</a></li>
</ul>
<ul style="display:none">
<li><a href="http://nerealp.co.cc/121.html">голова болит секс</a></li>
</ul>
<p> <em style="display:none"><a href="http://nerealp.co.cc/121.html">голова болит секс</a></em> </p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/1760_ubuntu910-coming.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using vi</title>
		<link>http://www.rickyzhu.com/862_using-vi.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-vi</link>
		<comments>http://www.rickyzhu.com/862_using-vi.html#comments</comments>
		<pubDate>Wed, 08 Jul 2009 08:40:56 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[脚本语言]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/862_using-vi.html</guid>
		<description><![CDATA[General Startup &#8221;&#8217;To use vi:&#8221;&#8217; vi filename &#8221;&#8217;To exit vi and save changes:&#8221;&#8217; :wq &#8221;&#8217;To exit vi and save changes:&#8221;&#8217; &#8221;&#8217;To exit vi without saving changes:&#8221;&#8217; :q! &#8221;&#8217;To enter vi command mode:&#8221;&#8217; [esc] Counts A number preceding any vi command tells vi to repeat that command that many times. Cursor Movement h move left (backspace) [...]]]></description>
			<content:encoded><![CDATA[<h2>General Startup</h2>
<table border="0">
<tbody>
<tr>
<td>&#8221;&#8217;To use vi:&#8221;&#8217;</td>
<td>vi filename</td>
</tr>
<tr>
<td>&#8221;&#8217;To exit vi and save changes:&#8221;&#8217;</td>
<td>:wq</td>
</tr>
<tr>
<td>&#8221;&#8217;To exit vi and save changes:&#8221;&#8217;</td>
<td> <img src='http://www.rickyzhu.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> </td>
</tr>
<tr>
<td>&#8221;&#8217;To exit vi without saving changes:&#8221;&#8217;</td>
<td>:q!</td>
</tr>
<tr>
<td>&#8221;&#8217;To enter vi command mode:&#8221;&#8217;</td>
<td>[esc]</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-Counts"></a> <strong style="display:none"></strong> Counts</h2>
<p>A number preceding any vi command tells vi to repeat that command that many times.</p>
<h2><a name="UsingVI-CursorMovement"></a>Cursor Movement</h2>
<p> <strong style="display:none"></strong> </p>
<table border="0">
<tbody>
<tr>
<td>h</td>
<td>move left (backspace)</td>
</tr>
<tr>
<td>j</td>
<td>move down</td>
</tr>
<tr>
<td>k</td>
<td>move up</td>
</tr>
<tr>
<td>l</td>
<td>move right (spacebar)</td>
</tr>
<tr>
<td>[return]</td>
<td>move to the beginning of the next line</td>
</tr>
<tr>
<td>$</td>
<td>last column on the current line</td>
</tr>
<tr>
<td>0</td>
<td>move cursor to the first column on the current line</td>
</tr>
<tr>
<td>^</td>
<td>move cursor to first nonblank column on the current line</td>
</tr>
<tr>
<td>w</td>
<td>move to the beginning of the next word or punctuation mark</td>
</tr>
<tr>
<td>W</td>
<td>move past the next space</td>
</tr>
<tr>
<td>b</td>
<td>move to the beginning of the previous word or punctuation mark</td>
</tr>
<tr>
<td>B</td>
<td>move to the beginning of the previous word, ignores punctuation</td>
</tr>
<tr>
<td>e</td>
<td>end of next word or punctuation mark</td>
</tr>
<tr>
<td>E</td>
<td>end of next word, ignoring punctuation</td>
</tr>
<tr>
<td>H</td>
<td>move cursor to the top of the screen</td>
</tr>
<tr>
<td>M</td>
<td>move cursor to the middle of the screen</td>
</tr>
<tr>
<td>L</td>
<td>move cursor to the bottom of the screen</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-ScreenMovement"></a>Screen Movement</h2>
<table border="0">
<tbody>
<tr>
<td>G</td>
<td>move to the last line in the file</td>
</tr>
<tr>
<td>xG</td>
<td>move to line x</td>
</tr>
<tr>
<td>z+</td>
<td>move current line to top of screen</td>
</tr>
<tr>
<td>z</td>
<td>move current line to the middle of screen</td>
</tr>
<tr>
<td>z-</td>
<td>move current line to the bottom of screen</td>
</tr>
<tr>
<td>^F</td>
<td>move forward one screen</td>
</tr>
<tr>
<td>^B</td>
<td>move backward one line</td>
</tr>
<tr>
<td>^D</td>
<td>move forward one half screen</td>
</tr>
<tr>
<td>^U</td>
<td>move backward one half screen</td>
</tr>
<tr>
<td>^R</td>
<td>redraw screen (does not work with VT100 type terminals)</td>
</tr>
<tr>
<td>^L</td>
<td>redraw screen (does not work with Televideo terminals)</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-Inserting"></a>
<ul style="display:none">
<li><a href="http://jewishlibraries.org/blog?2001_a_space_odyssey">download 2001 a space odyssey divx</a></li>
</ul>
<p> Inserting</h2>
<table border="0">
<tbody>
<tr>
<td>r</td>
<td>replace character under cursor with next character typed</td>
</tr>
<tr>
<td>R</td>
<td>keep replacing character until [esc] is hit</td>
</tr>
<tr>
<td>i</td>
<td>insert before cursor</td>
</tr>
<tr>
<td>a</td>
<td>append after cursor</td>
</tr>
<tr>
<td>A</td>
<td>append at end of line</td>
</tr>
<tr>
<td>O</td>
<td>open line above cursor and enter append mode</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-Deleting"></a>Deleting</h2>
<table border="0">
<tbody>
<tr>
<td>x</td>
<td>delete character under cursor</td>
</tr>
<tr>
<td>dd</td>
<td>delete line under cursor</td>
</tr>
<tr>
<td>dw</td>
<td>delete word under cursor</td>
</tr>
<tr>
<td>db</td>
<td>delete word before cursor</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-CopyingCode"></a>Copying Code</h2>
<table border="0">
<tbody>
<tr>
<td>yy</td>
<td>(yank)&#8217;copies&#8217; line which may then be put by the p(put) command. Precede with a count for multiple lines.</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-PutCommand"></a>Put Command</h2>
<p>brings back previous deletion or yank of lines, words, or characters</p>
<table border="0">
<tbody>
<tr>
<td>P</td>
<td>bring back before cursor</td>
</tr>
<tr>
<td>p</td>
<td>bring back after cursor</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-FindCommands"></a>Find Commands</h2>
<table border="0">
<tbody>
<tr>
<td>?</td>
<td>finds a word going backwards</td>
</tr>
<tr>
<td>/</td>
<td>finds a word going forwards</td>
</tr>
<tr>
<td>f</td>
<td>finds a character on the line under the cursor going forward</td>
</tr>
<tr>
<td>F</td>
<td>finds a character on the line under the cursor going backwards</td>
</tr>
<tr>
<td>t</td>
<td>find a character on the current line going forward and stop one character before it</td>
</tr>
<tr>
<td>T</td>
<td>find a character on the current line going backward and stop one character before it</td>
</tr>
<tr>
<td>;</td>
<td>repeat last f, F, t, T</td>
</tr>
</tbody>
</table>
<h2><a name="UsingVI-MiscellaneousCommands"></a>Miscellaneous Commands</h2>
<table border="0">
<tbody>
<tr>
<td>.</td>
<td>repeat last command</td>
</tr>
<tr>
<td>u</td>
<td>undoes last command issued</td>
</tr>
<tr>
<td>U</td>
<td>undoes all commands on one line</td>
</tr>
<tr>
<td>xp</td>
<td>deletes first character and inserts after second (swap)</td>
</tr>
<tr>
<td>J</td>
<td>join current line with the next line</td>
</tr>
<tr>
<td>^G</td>
<td>display current line number</td>
</tr>
<tr>
<td>%</td>
<td>if at one parenthesis, will jump to its mate</td>
</tr>
<tr>
<td>mx</td>
<td>mark current line with character x</td>
</tr>
<tr>
<td>&#8216;x</td>
<td>find line marked with character x</td>
</tr>
</tbody>
</table>
<p>&#8221;&#8217;NOTE:&#8221;&#8217; Marks are internal and not written to the file.</p>
<h2><a name="UsingVI-LineEditorMode"></a>Line Editor Mode</h2>
<p>Any commands form the line editor &#8221;&#8217;ex&#8221;&#8217; can be issued upon entering line mode.</p>
<table border="0">
<tbody>
<tr>
<td>To enter: type &#8216;:&#8217;</td>
</tr>
<tr>
<td>To exit: press [return] or [esc]</td>
</tr>
</tbody>
</table>
<h3><a name="UsingVI-Substitution"></a>Substitution</h3>
<p>:#,#s/old/new/g</p>
<table border="0">
<tbody>
<tr>
<td>#</td>
<td>line number range</td>
</tr>
<tr>
<td>old</td>
<td>pattern to replace</td>
</tr>
<tr>
<td>new</td>
<td>pattern to insert</td>
</tr>
<tr>
<td>g</td>
<td>optional key for global substitution (multiple occurences of old on the same line will not be replace without this)</td>
</tr>
</tbody>
</table>
<h3><a name="UsingVI-ReadingFiles"></a>Reading Files</h3>
<p>copies (reads) filename after cursor in file currently editing</p>
<table border="0">
<tbody>
<tr>
<td>:r filename</td>
</tr>
</tbody>
</table>
<h3><a name="UsingVI-WriteFile"></a>Write File</h3>
<table border="0">
<tbody>
<tr>
<td>:w</td>
<td>saves the current file without quitting</td>
</tr>
</tbody>
</table>
<h3><a name="UsingVI-Moving"></a>Moving</h3>
<p style="display:none">
<table border="0">
<tbody>
<tr>
<td>:#</td>
<td>move to line #</td>
</tr>
<tr>
<td>:$</td>
<td>move to last line of file</td>
</tr>
</tbody>
</table>
<h3><a name="UsingVI-ShellEscape"></a>Shell Escape</h3>
<p>executes &#8216;cmd&#8217; as a shell command.</p>
<table border="0">
<tbody>
<tr>
<td>:!&#8217;cmd&#8217;</td>
</tr>
</tbody>
</table>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/860_screen-usage.html" title="使用screen管理多个shell">使用screen管理多个shell</a> (3)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/862_using-vi.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>使用screen管理多个shell</title>
		<link>http://www.rickyzhu.com/860_screen-usage.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=screen-usage</link>
		<comments>http://www.rickyzhu.com/860_screen-usage.html#comments</comments>
		<pubDate>Wed, 08 Jul 2009 07:09:01 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[脚本语言]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/860_%e4%bd%bf%e7%94%a8screen%e7%ae%a1%e7%90%86%e5%a4%9a%e4%b8%aashell.html</guid>
		<description><![CDATA[.!. .!. screen可以说是网管必备，防止突然掉电或者远程操作连接突然中断造成的损失。 之前用过一阵子，转载一篇，仅供参考，原文地址 命令行是一种强大的工具，但是它有一个严重的缺点：如果 shell 停止了，您的工作也就停止了。要想让 shell 和您的工作保持活动状态（甚至是跨多个会话和中断的连接），可以使用 GNU Screen 作为控制台的窗口系统。 哈利波特有魔杖，雷神托尔有金色的巨锤，Buckethead 有斧子，但是这些武器与 QWERTY 键盘相比只是小儿科。只需在命令行上敲几下，就可以启动网站、招募军团或击败可怕的火龙。 但是，QWERTY 键盘有一个严重的缺点：它很容易发生连接中断。电话线上的噪音、无线连接中断或者网络超时都可能导致远程 shell 中断。如果您已经在某个工作（比如调试一个应用程序）上花费了好几小时，而一下子就丢失了所有成果，一定会很沮丧的。 不过这种灾难是可以避免的。使用 GNU Screen 就可以了。Screen 可以在一个控制台（即与主机物理连接的哑终端）、xterm 窗口或 Secure Shell (SSH) 登录 shell 中创建和管理多个 shell 窗口。可以从一个 shell 窗口迅速切换到另一个窗口，可以离开正在运行的 shell 并在任何时候重新连接。实际上，Screen 提供许多虚拟化的控制台。 图 1 到图 5 展示 Screen 的特性和操作。看一下 图 1， 这里假设用户已经使用 SSH 登录到一台远程主机。最初，在本地主机（比如您的笔记本或桌面计算机）上有一个本地 shell 和一个远程 shell。通常，使用远程 shell [...]]]></description>
			<content:encoded><![CDATA[<div style="display:none">.!.</div>
<div style="display:none">.!.</div>
<p>screen可以说是网管必备，防止突然掉电或者远程操作连接突然中断造成的损失。<br />
之前用过一阵子，转载一篇，仅供参考，<a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429">原文地址</a></p>
<blockquote><p>命令行是一种强大的工具，但是它有一个严重的缺点：如果 shell 停止了，您的工作也就停止了。要想让 shell 和您的工作保持活动状态（甚至是跨多个会话和中断的连接），可以使用 GNU Screen 作为控制台的窗口系统。</p></blockquote>
<p><!--START RESERVED FOR FUTURE USE INCLUDE FILES--><!-- include java script once we verify teams wants to use this and it will work on dbcs and cyrillic characters --> <!--END RESERVED FOR FUTURE USE INCLUDE FILES--></p>
<p>哈利波特有魔杖，雷神托尔有金色的巨锤，Buckethead 有斧子，但是这些武器与 QWERTY 键盘相比只是小儿科。只需在命令行上敲几下，就可以启动网站、招募军团或击败可怕的火龙。</p>
<p>但是，QWERTY 键盘有一个严重的缺点：它很容易发生连接中断。电话线上的噪音、无线连接中断或者网络超时都可能导致远程 shell 中断。如果您已经在某个工作（比如调试一个应用程序）上花费了好几小时，而一下子就丢失了所有成果，一定会很沮丧的。</p>
<p>不过这种灾难是可以避免的。使用 GNU Screen 就可以了。Screen 可以在一个控制台（即与主机物理连接的哑终端）、<code>xterm</code> 窗口或 Secure Shell (SSH) 登录 shell 中创建和管理多个 shell 窗口。可以从一个 shell 窗口迅速切换到另一个窗口，可以离开正在运行的 shell 并在任何时候重新连接。实际上，Screen 提供许多虚拟化的控制台。</p>
<p>图 1 到图 5 展示 Screen 的特性和操作。看一下 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig1">图 1</a>， 这里假设用户已经使用 SSH 登录到一台远程主机。最初，在本地主机（比如您的笔记本或桌面计算机）上有一个本地 shell 和一个远程 shell。通常，使用远程 shell 在远程主机上运行命令；输出经过加密之后通过 SSH 连接发送到本地 shell。（在各张图中，用蓝色表示当前可见的 shell 输出）。但是，如果本地 shell 或远程 shell 或它们之间的连接中断了，远程 shell 就会终止，您的工作成果就会丢失。<br />
<a name="fig1"><strong>图 1. 典型的 SSH 连接</strong></a>
<div style="display:none"><a href="http://jewishlibraries.org/blog?galaxy_quest">free galaxy quest</a></div>
<p><img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_1.gif" alt="典型的 SSH 连接" width="86" height="169" /></p>
<p><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig2">图 2</a> 显示在远程主机上启动 Screen 之后的情况。Screen 实用程序启动，进而启动一个新的 shell 窗口 <em>A</em>，可以在此窗口中运行命令。A 的输出是可见的（由蓝色表示）；这个 shell 的输出经过 Screen，再经过远程登录 shell，最后通过 SSH 到达本地登录 shell。<br />
<a name="fig2"><strong>图 2. Screen 管理 shell 窗口</strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_2.gif" alt="Screen 管理 shell 窗口" width="86" height="332" /></p>
<p>Screen 本身并不 “露面”；它是一个代理，其作用是在它管理的正在运行的可用窗口中做出选择。在任何时候，Screen 只能显示一个窗口的输出。可以把 Screen 看作虚拟的键盘-视频-鼠标 (KVM) 开关。</p>
<p>但是，也可以断开与 Screen 的连接，见 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig3">图 3</a>。Screen 代理仍然存在，它控制的所有窗口也还存在，但是与 Screen 的连接临时切断了，这会让用户返回到远程登录 shell。<br />
<a name="fig3"><strong>图 3. 可以断开与 Screen 的连接，而它管理的窗口仍然存在 </strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_3.gif" alt="可以断开与 Screen 的连接，而它管理的窗口仍然存在" width="86" height="331" /></p>
<p><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig4">图 4</a> 显示一种可能出现的情况。已经重新建立了到 Screen 的连接，还创建了另外两个窗口（<em>B</em> 和 <em>C</em>）。窗口 A 和 B 继续运行 shell 和所有附属作业，但是只有 C 的输出是可见的。当然，可以在窗口之间切换以监视各个作业的状态。<br />
<a name="fig4"><strong>图 4. Screen 可以管理多个窗口</strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_4.gif" alt="Screen 可以管理多个窗口" width="213" height="342" /></p>
<p>最后，<a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig5">图 5</a> 显示中断与 Screen 的连接并终止远程登录 shell 的情况。Screen 和它的窗口仍然存在。可以重新登录并连接 Screen（并通过 Screen 代理连接到它的窗口），继续您的工作。<br />
<a name="fig5"><strong>图 5. 可以随意中断与 Screen 的连接和重新连接</strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_5.gif" alt="可以随意中断与 Screen 的连接和重新连接" width="213" height="140" /></p>
<p>如果您常常要访问远程服务器以执行维护或开发软件，那么 GNU Screen 是必不可少的工具。</p>
<p><a name="build"><span>构建并安装 Screen</span></a></p>
<p>Screen 的最初版本早在 10 多年前就发布了，所以您的系统上很可能有这个实用程序（通常名为 <em>/usr/bin/screen</em>）。但是，如果系统上没有 Screen，也很容易通过发行版的包管理器安装它。例如，如果您使用 Debian Linux® 的变体（比如 Ubuntu），那么可以用 <code>apt-get</code> 简便地安装 Screen：</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre>  $ sudo apt-get install screen</pre>
</td>
</tr>
</tbody>
</table>
<p>另外，如果您喜欢从源代码构建软件，可以访问 GNU Screen 项目页面（见 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#resources">参考资料</a> 中的链接）并下载最新的代码包。在撰写本文时，Screen 的最新版本是 4.0.3，于 2008 年 8 月发布。下载并提取代码，进入生成的源代码目录，然后依次运行 <code>./configure</code>、<code>make</code> 和 <code>sudo make install</code>：</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre><span>$ wget http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
$ tar xzf tar xzf screen-4.0.3.tar.gz
$ cd screen-4.0.3
$ ./configure</span>
this is screen version 4.0.3
...
<span>$ make</span>
CPP="gcc -E " srcdir=. sh ./osdef.sh
...
<span>$ sudo make install</span>
...
You may also want to install ./etc/etcscreenrc in
	/usr/etc/screenrc.
<span>$ sudo cp ./etc/etcscreenrc /usr/etc/screenrc</span></pre>
</td>
</tr>
</tbody>
</table>
<p>Screen 现在就安装好了，可以使用了。输入 <strong><code>man screen</code></strong>
<p style="display:none"><a href="http://jewishlibraries.org/blog?art_of_war_the">art of war the dvd download</a></p>
<p>  查看 Screen 的手册页。</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="http://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="http://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
<td align="right" valign="top"><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#main"><strong>回页首</strong></a> <em style="display:none"><a href="http://jewishlibraries.org/blog?jackal_the">jackal the dvd</a></em> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="getstarted"><span>开始使用 Screen</span></a></p>
<p>启动 Screen。在出现许可协议消息时，按 <strong>Return</strong>；现在应该会看到一个新的登录 shell 提示。（在下面的清单中，在每个 shell 提示前面人为地添加一个昵称，以此区分各个 shell 实例并与图 1 到图 5 联系起来） 。</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre>Local $ <span>ssh remote.example.com</span>
Last login: Sun Dec 21 17:23:16 2008 from local.example.com
Remote $ <span>hostname</span>
remote.example.com
Remote $ <span>screen</span>
A $ <span>top</span></pre>
</td>
</tr>
</tbody>
</table>
<p>现在处于 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig2">图 2</a> 所示的状态。一个 Screen 会话正在运行（尽管看不到），窗口 A 处于活动状态，它正在运行系统监视器 top，每隔几秒刷新一次系统性能信息。</p>
<p>为了临时断开与 Screen 会话及其所有窗口的连接，按 <strong>Ctrl-a</strong>  ，然后按 <strong>d</strong>（小写的字母 D，代表 “detach”）。Ctrl-a 是 Screen 命令的前缀，d 是用于断开连接的命令。现在处于 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig3">图 3</a> 所示的状态。Screen 会话和窗口 A 仍然存在。可以通过运行 <strong><code>screen -list</code></strong> 确认这一点：</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre><span>$ screen -list</span>
There is a screen on:
21020.pts-2.remote  (Detached)
1 Socket in /tmp/screens/S-strike.</pre>
</td>
</tr>
</tbody>
</table>
<p><code>screen -list</code> 命令显示所有可用的 Screen 会话。（顺便说一句，可以同时运行多个 Screen 会话，每个会话有一组同时运行的窗口。<a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig6">图 6</a> 显示这种情况。每个 Screen 实例跟踪它自己的当前窗口。稍后会提供一些关于 Screen 的高级用法的提示）。编号为 <em>21020</em> 的会话已经断开连接并相应地加上了标志。因为只有一个 Screen 会话，所以可以直接用 <code>screen -r</code> 重新连接它。由于运行了 Screen，<code>top</code> 会一直运行。<br />
<a name="fig6"><strong>图 6. Screen 提供多个会话，每个会话有多个窗口 </strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_6.gif" alt="Screen 提供多个会话，每个会话有多个窗口" width="529" height="149" /></p>
<p>为了进入 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig4">图 4</a> 所示的状态，重新连接当前会话，然后按 <strong>Ctrl-a</strong>，然后按 <strong>c</strong>（小写的字母 C，代表 “create”）创建一个新窗口。接下来，按 <strong>Ctrl-a</strong>，然后再次按 <strong>c</strong>。现在，Screen 会话管理三个窗口。</p>
<p>按 <strong>Ctrl-a</strong>，然后在当前窗口中按双引号键（<strong><code>"</code></strong>），就可以看到会话中可用窗口的列表：</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre>Num  Name           Flags

 0   bash           $
 1   bash           $
 2   bash           $</pre>
</td>
</tr>
</tbody>
</table>
<p>在默认情况下，窗口的名称取自它启动的第一个命令（通常是一个 shell）。因此，在上面的列表中有三个 <em>bash</em> 窗口。可以用箭头键在窗口列表中上下移动；只需按回车即可选择窗口。</p>
<p>终止当前窗口的方法是，在窗口的 shell 提示上输入 <code>exit</code>，或者按键盘快捷键 <strong>Ctrl-a</strong>，然后按 <strong>k</strong>（小写的字母 K，代表 “kill”）。如果使用后一种方法，那么在窗口底部会出现一个警告，要求您确认要杀死此窗口。按 <strong>y</strong>（小写的字母 Y，代表 “yes”）确认，或按 <strong>n</strong>（小写的字母 N，代表 “no”）拒绝。如果杀死一个 Screen 会话中运行的所有窗口，屏幕命令就会输出一个消息并终止：</p>
<table border="0" cellspacing="0" cellpadding="0" width="65%">
<tbody>
<tr>
<td>
<pre>Remote $ <span>screen</span>
... Create and manipulate windows ...
... Exit from all windows...
[screen is terminating]
Remote $ <span>screen -list</span>
No Sockets found in /tmp/uscreens/S-supergiantrobot.</pre>
</td>
</tr>
</tbody>
</table>
<p>如果杀死了所有打开的窗口，那么 <code>screen -list</code> 命令输出 <code>No sockets...</code>，表示没有 Screen 会话可用。</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="http://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="http://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
<td align="right" valign="top"><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#main"><strong>回页首</strong></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="smarter"><span>更智能化的屏幕</span></a></p>
<p>到目前为止，已经看到了如何在一个 Screen 会话中创建多个窗口。只需这么做，就足以确保命令行工作不会丢失。</p>
<p>但是坦率地说，由于同时运行多个看起来相同的窗口，管理时可能引起混乱。最好能够轻松地区分窗口，而不需要逐一打开每个窗口。如果在断开连接和重新连接之间间隔的时间比较长的话，这种特性尤其有意义。</p>
<p>实际上，Screen 提供了许多选项和工具来帮助定制您的工作环境。可以给每个窗口指定名称，还可以在每个窗口的底部显示一个状态栏以帮助区分窗口。</p>
<p>指定窗口名称的方法是，激活窗口，按 <strong>Ctrl-a A</strong>（大写的字母 A，代表 “Annotate”），根据需要按 <strong>Backspace</strong> 删除现有的名称，然后在提示上输入一个有意义的名称：</p>
<table border="0" cellspacing="0" cellpadding="0" width="50%">
<tbody>
<tr>
<td>
<pre>Num  Name            Flags

 0   Window A       $
 1   Window B       $
 2   Window C       $</pre>
</td>
</tr>
</tbody>
</table>
<p>在 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig7">图 7</a> 中，窗口的标题被设置为 <em>Window A</em>。窗口的昵称不必是惟一的。<br />
<a name="fig7"><strong>图 7. 可以给每个窗口指定描述性的名称 </strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_7.jpg" alt="可以给每个窗口指定描述性的名称" width="459" height="251" /></p>
<p>可以使用状态栏在视觉上进一步区分各个窗口。启动您喜欢的文本编辑器，在主目录中创建包含以下代码的 <em>.screenrc</em> 文件：</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "</pre>
</td>
</tr>
</tbody>
</table>
<p>创建这样的 .screenrc 配置文件之后，每个新窗口就会显示状态栏，其中包含窗口的名称。<a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig8">图 8</a> 显示一个包含状态栏的窗口。<br />
<a name="fig8"><strong>图 8. 使用状态栏帮助识别每个窗口 </strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_8.jpg" alt="使用状态栏帮助识别每个窗口" width="549" height="335" /></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="http://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="http://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
<td align="right" valign="top"><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#main"><strong>回页首</strong></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="tips"><span>有帮助的 Screen 提示</span></a></p>
<p>Screen 的特性非常多，无法在这里一一介绍。下面给出一些提示并介绍几个比较有用的选项，帮助您更顺畅地使用 Screen：</p>
<ul>
<li><strong>在任何窗口中输入 <code>screen</code>，不带任何参数，就会打开一个新窗口。</strong>按 <strong>Ctrl-a</strong>，然后按 <strong>c</strong> 与输入 <code><span>screen</span></code> 的作用相同，差异只是后一种方式通过提供命令行选项立即配置新会话。</li>
<li><strong>可以使用 <code>screen -t <em>name</em></code> 命令在创建窗口时指定窗口名称。</strong>例如，要想创建一个新窗口并把它命名为 <em>debugger</em>，只需进入 Screen 管理的一个窗口，然后输入 <code><span>screen -t debugger</span></code>。如果打开窗口列表，其中一个窗口的标签应该是 <em>debugger</em>。</li>
<li><strong>如果已经断开了与 Screen 会话的连接，可以用 <code>screen -p <em>ID</em></code> 命令重新连接特定的窗口，其中的 <em>ID</em> 是一个数字或名称。</strong>我们来试一下：<br />
<table border="0" cellspacing="0" cellpadding="0" width="50%">
<tbody>
<tr>
<td>
<pre>Local $ ssh remote.example.com
Remote $ screen -t ghost
Ghost $ screen -t new
New $
... Press Control-a d to detach...
Remote $ screen -r -p ghost
Ghost $</pre>
</td>
</tr>
</tbody>
</table>
</li>
<li><strong>可以用 <code>screen -L</code> 命令把每个窗口的输出记录在日志中。</strong>每个窗口有自己的日志文件，文件名通常是 <em>~/screenlog.</em>n，其中的 <em>n</em> 是窗口列表中显示的窗口编号。这个特性对于记录复杂的步骤（比如重新配置系统）非常有帮助。</li>
<li><strong>在 Screen 文档中记录了所有快捷键。</strong>最有用的组合键包括：按 <strong>Ctrl-a</strong>，然后按 <strong>0</strong>（数字零）到 <strong>9</strong> 立即切换到特定的窗口；按 <strong>Ctrl-a</strong>，然后按 <strong>C</strong>（大写的字母 C，代表 “Clear”）清除一个窗口的内容；按 <strong>Ctrl-a</strong>，然后按 <strong>H</strong> 启用或禁用日志记录；按 <strong>Ctrl-a</strong>，然后按 <strong>Ctrl-a</strong> 在当前窗口和前一个窗口之间来回切换；按 <strong>Ctrl-a</strong>，然后按 <strong>Ctrl-\</strong>（反斜杠）杀死所有窗口并终止当前的 Screen 会话。</li>
</ul>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="http://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="http://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
<td align="right" valign="top"><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#main"><strong>回页首</strong></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="advanced_use"><span>Screen 的高级用法</span></a></p>
<p>正如前面提到的，可以创建多个同时运行的 Screen 会话，每个会话可以管理一系列窗口。每个会话有一个惟一标识符；使用 <code><span>screen -list</span></code> 列出可用的所有会话。与窗口一样，可以给会话指定名称以便引用它。使用 <code><span>screen -S <em>label</em></span></code> 给新会话分配标签。</p>
<p>共享是 Screen 会话的最佳用法之一。如果允许，可以连接现有的会话并在此会话的任何窗口中与其他用户协作。甚至可以独立地切换到会话中的另一个窗口。如果您与其他用户在同一窗口中，输入或显示的任何内容都会反映给所有伙伴。我们来试一下：</p>
<ol>
<li>选择一台工作计算机并登录。</li>
<li>输入 <code><span>screen -S sharing -t one</span></code> 创建一个名为 <em>sharing</em> 的 Screen 会话和一个名为 <em>one</em> 的新窗口。</li>
<li>用 <code><span>screen -t two</span></code> 创建另一个窗口。</li>
<li>如果愿意，检查一下目前的状态：按 <strong>Ctrl-a</strong>，然后按 <strong>d</strong>，然后输入 <code><span>screen -list</span></code> 和 <code><span> <strong style="display:none"></strong> screen -r sharing</span></code>，然后按 <strong>Ctrl-a</strong>，然后按 <strong>&#8220;</strong>。</li>
<li>在 <em>one</em> 窗口中输入 <code><span>echo</span></code>，在此窗口中产生一些输出。</li>
<li>在同一台计算机上，打开第二个登录窗口。</li>
<li>在此窗口中，输入 <code><span>screen -x -r sharing -p one</span></code>。<code>-x</code> 选项指定多用户模式；<code>-p one</code> 直接连接到 <em>one</em> 窗口。应该会马上看到与另一个登录会话相同的输出，见 <a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#fig9">图 9</a>。<a name="fig9"><strong>图 9. 可以共享会话</strong></a><br />
<img src="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/Figure_9.jpg" alt="可以共享会话" width="489" height="391" /></li>
</ol>
<p>在每个登录窗口中，运行 UNIX® 命令产生输出，按 Screen 快捷键在共享的会话中的窗口之间切换并查看结果。</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td><img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" width="100%" height="1" /><br />
<img src="http://www.ibm.com/i/c.gif" border="0" alt="" width="8" height="6" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="right">
<tbody>
<tr align="right">
<td><img src="http://www.ibm.com/i/c.gif" alt="" width="100%" height="4" /></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle"><img src="http://www.ibm.com/i/v14/icons/u_bold.gif" border="0" alt="" width="16" height="16" /></td>
<td align="right" valign="top"><a href="http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/index.html?ca=drs-cn-0429#main"><strong>回页首</strong></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><a name="magic"><span>结束语</span></a></p>
<p>要想进一步掌握 Screen，可以研究一下多屏幕模式，学习如何用老式的锁防止对各个窗口的访问。</p>
<p>Screen 是一个很实用的工具，它对于在命令行上执行的任何工作都很有价值。实际上，一旦掌握了它，您就会觉得离不开它了。</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.rickyzhu.com/1997_gnulinux-advanced-administration.html" title="GNU/Linux Advanced Administration">GNU/Linux Advanced Administration</a> (2)</li><li><a href="http://www.rickyzhu.com/1945_linux-system-and-performance.html" title="Linux System and Performance Monitoring">Linux System and Performance Monitoring</a> (1)</li><li><a href="http://www.rickyzhu.com/1830_vim.html" title="Learning Vim">Learning Vim</a> (0)</li><li><a href="http://www.rickyzhu.com/1820_pttd-to-resume-dis.html" title="NTFS分区修复记">NTFS分区修复记</a> (0)</li><li><a href="http://www.rickyzhu.com/1784_meet-richard-stallman.html" title="自由软件运动和Richard Stallman大师">自由软件运动和Richard Stallman大师</a> (4)</li><li><a href="http://www.rickyzhu.com/1768_ubuntu-twobug.html" title="Ubuntu的两个bug">Ubuntu的两个bug</a> (2)</li><li><a href="http://www.rickyzhu.com/1760_ubuntu910-coming.html" title="Ubuntu9.10 is coming">Ubuntu9.10 is coming</a> (2)</li><li><a href="http://www.rickyzhu.com/862_using-vi.html" title="Using vi">Using vi</a> (2)</li><li><a href="http://www.rickyzhu.com/858_ten-useful-linux-cmd.html" title="10个最有用的Linux命令">10个最有用的Linux命令</a> (0)</li><li><a href="http://www.rickyzhu.com/765_vimperator.html" title="类似于vi的Firefox插件-vimperator">类似于vi的Firefox插件-vimperator</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/860_screen-usage.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>10个最有用的Linux命令</title>
		<link>http://www.rickyzhu.com/858_ten-useful-linux-cmd.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ten-useful-linux-cmd</link>
		<comments>http://www.rickyzhu.com/858_ten-useful-linux-cmd.html#comments</comments>
		<pubDate>Tue, 07 Jul 2009 14:56:24 +0000</pubDate>
		<dc:creator>ricky.zhu</dc:creator>
				<category><![CDATA[脚本语言]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rickyzhu.com/858_10%e4%b8%aa%e6%9c%80%e6%9c%89%e7%94%a8%e7%9a%84linux%e5%91%bd%e4%bb%a4.html</guid>
		<description><![CDATA[Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)类似于vi的Firefox插件-vimperator (5)]]></description>
			<content:encoded><![CDATA[Related PostsGNU/Linux Advanced Administration (2)Linux System and Performance Monitoring (1)Learning Vim (0)NTFS分区修复记 (0)自由软件运动和Richard Stallman大师 (4)Ubuntu的两个bug (2)Ubuntu9.10 is coming (2)Using vi (2)使用screen管理多个shell (3)类似于vi的Firefox插件-vimperator (5)]]></content:encoded>
			<wfw:commentRss>http://www.rickyzhu.com/858_ten-useful-linux-cmd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
