<?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>侯波林的blog &#187; linux系统命令</title>
	<atom:link href="http://houbolin.cn/blog/category/linux%e7%b3%bb%e7%bb%9f%e5%91%bd%e4%bb%a4/feed/" rel="self" type="application/rss+xml" />
	<link>http://houbolin.cn/blog</link>
	<description>PHP Perl APACHE MYSQL LINUX</description>
	<lastBuildDate>Mon, 13 Feb 2012 15:16:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ubuntu 面板恢复命令(zhuan)</title>
		<link>http://houbolin.cn/blog/2010/07/11/ubuntu-%e9%9d%a2%e6%9d%bf%e6%81%a2%e5%a4%8d%e5%91%bd%e4%bb%a4zhuan/</link>
		<comments>http://houbolin.cn/blog/2010/07/11/ubuntu-%e9%9d%a2%e6%9d%bf%e6%81%a2%e5%a4%8d%e5%91%bd%e4%bb%a4zhuan/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 01:59:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>
		<category><![CDATA[ubuntu 面板]]></category>
		<category><![CDATA[ubuntu 面板 panel 恢复声音 网络]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=135</guid>
		<description><![CDATA[打开终端，终端窗口打开之后，立即在提示符后面输入下列命令：
gconftool &#8211;recursive-unset /apps/panel
（注意：每个斜杠 “/” 后面没有空格）
接下来输入下列命令：
rm -rf ~/.gconf/apps/panel
最后还需要执行：
pkill gnome-panel
接下来，Ubuntu 默认的上下两栏面板就会恢复默认值，出现顶部+底部各一面板的默认布局。
]]></description>
			<content:encoded><![CDATA[<p>打开终端，终端窗口打开之后，立即在提示符后面输入下列命令：</p>
<p>gconftool &#8211;recursive-unset /apps/panel</p>
<p>（注意：每个斜杠 “/” 后面没有空格）</p>
<p>接下来输入下列命令：</p>
<p>rm -rf ~/.gconf/apps/panel</p>
<p>最后还需要执行：</p>
<p>pkill gnome-panel</p>
<p>接下来，Ubuntu 默认的上下两栏面板就会恢复默认值，出现顶部+底部各一面板的默认布局。</p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2010/07/11/ubuntu-%e9%9d%a2%e6%9d%bf%e6%81%a2%e5%a4%8d%e5%91%bd%e4%bb%a4zhuan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何解决SSH超时断开连接</title>
		<link>http://houbolin.cn/blog/2010/01/14/%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3ssh%e8%b6%85%e6%97%b6%e6%96%ad%e5%bc%80%e8%bf%9e%e6%8e%a5/</link>
		<comments>http://houbolin.cn/blog/2010/01/14/%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3ssh%e8%b6%85%e6%97%b6%e6%96%ad%e5%bc%80%e8%bf%9e%e6%8e%a5/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 06:21:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>
		<category><![CDATA[SSH 超时 断开 连接]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=82</guid>
		<description><![CDATA[高版本的Linux自带的OpenSSH在使用的时候，几分钟不操作的话就会自动断开连接，这是出于安全的考虑，但是对于需要长时间使用的用户(比如开发者&#8230;)来说很麻烦，每次都要重新连接。解决方法如下：
将/etc/ssh/sshd_config中的“ClientAliveInterval”设置取消注释，并把0改为一个较小的数值即可(比如50)。
]]></description>
			<content:encoded><![CDATA[<p>高版本的Linux自带的OpenSSH在使用的时候，几分钟不操作的话就会自动断开连接，这是出于安全的考虑，但是对于需要长时间使用的用户(比如开发者&#8230;)来说很麻烦，每次都要重新连接。解决方法如下：</p>
<p>将/etc/ssh/sshd_config中的“ClientAliveInterval”设置取消注释，并把0改为一个较小的数值即可(比如50)。</p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2010/01/14/%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3ssh%e8%b6%85%e6%97%b6%e6%96%ad%e5%bc%80%e8%bf%9e%e6%8e%a5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu下使用新立得安装的apache启动模块的方法</title>
		<link>http://houbolin.cn/blog/2010/01/05/ubuntu%e4%b8%8b%e4%bd%bf%e7%94%a8%e6%96%b0%e7%ab%8b%e5%be%97%e5%ae%89%e8%a3%85%e7%9a%84apache%e5%90%af%e5%8a%a8%e6%a8%a1%e5%9d%97%e7%9a%84%e6%96%b9%e6%b3%95/</link>
		<comments>http://houbolin.cn/blog/2010/01/05/ubuntu%e4%b8%8b%e4%bd%bf%e7%94%a8%e6%96%b0%e7%ab%8b%e5%be%97%e5%ae%89%e8%a3%85%e7%9a%84apache%e5%90%af%e5%8a%a8%e6%a8%a1%e5%9d%97%e7%9a%84%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 08:06:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=72</guid>
		<description><![CDATA[sudo a2enmod rewrite
关闭此模块可使用
sudo a1dismod rewrite
]]></description>
			<content:encoded><![CDATA[<p>sudo a2enmod rewrite</p>
<p>关闭此模块可使用</p>
<p>sudo a1dismod rewrite</p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2010/01/05/ubuntu%e4%b8%8b%e4%bd%bf%e7%94%a8%e6%96%b0%e7%ab%8b%e5%be%97%e5%ae%89%e8%a3%85%e7%9a%84apache%e5%90%af%e5%8a%a8%e6%a8%a1%e5%9d%97%e7%9a%84%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu 下flash乱码</title>
		<link>http://houbolin.cn/blog/2009/12/29/ubuntu-%e4%b8%8bflash%e4%b9%b1%e7%a0%81/</link>
		<comments>http://houbolin.cn/blog/2009/12/29/ubuntu-%e4%b8%8bflash%e4%b9%b1%e7%a0%81/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 05:16:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=66</guid>
		<description><![CDATA[如果在ubuntu 下碰到flash乱码问题,可以使用以下命令
sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak
&#160;
sudo rm /etc/fonts/conf.d/49-sansserif.conf 
]]></description>
			<content:encoded><![CDATA[<p>如果在ubuntu 下碰到flash乱码问题,可以使用以下命令<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="bash"><div class="devcodeoverflow">sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak
&nbsp;
sudo rm /etc/fonts/conf.d/49-sansserif.conf </div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2009/12/29/ubuntu-%e4%b8%8bflash%e4%b9%b1%e7%a0%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache 虚拟主机 403 Forbidden</title>
		<link>http://houbolin.cn/blog/2009/12/24/apache-%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba-403-forbidden/</link>
		<comments>http://houbolin.cn/blog/2009/12/24/apache-%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba-403-forbidden/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=56</guid>
		<description><![CDATA[apache 虚拟主机 403 Forbidden]]></description>
			<content:encoded><![CDATA[<p>今天同事配置apache虚拟主机时发现 配置好设置后,依然无法访问。<br />
查看权限没有问题。所有目录具有读权限.<br />
用strace跟踪apache查看后,发现到 文件父级目录可以访问,但到要访问的文件后系统state 报错,这说明apache虚拟主机配置正确,已经正确的路由到了文件。问题出现在权限上。<br />
写一个测试脚本,state改文件发现权限正常,问题处在什么地方呢？<br />
测试发现将虚拟主机目录设在 apache默认目录 /var/www/htdocs/下访问正常！<br />
突然想起来,centerOS默认是将 SElinux打开的！关掉selinux就可以了～～</p>
<p>关掉selinux可以将 /etc/sysconfig/selinux 中的  SELINUX=permissive 改成   SELINUX=disabled ,重启机器;当然,如果不想重启机器 执行<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="bash"><div class="devcodeoverflow">
setenforce 0 
</div></pre><!--END_DEVFMTCODE--><br />
命令即可</p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2009/12/24/apache-%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba-403-forbidden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux ulimit 命令(转)</title>
		<link>http://houbolin.cn/blog/2009/12/09/linux-ulimit-%e5%91%bd%e4%bb%a4%e8%bd%ac/</link>
		<comments>http://houbolin.cn/blog/2009/12/09/linux-ulimit-%e5%91%bd%e4%bb%a4%e8%bd%ac/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:17:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=45</guid>
		<description><![CDATA[ulimit -a 用来显示当前的各种用户进程限制。
    Linux对于每个用户，系统限制其最大进程数。为提高性能，可以根据设备资源情况，
    设置各linux 用户的最大进程数，下面我把某linux用户的最大进程数设为10000个：
     ulimit -u 10000
     对于需要做许多 socket 连接并使它们处于打开状态的 Java 应用程序而言，
     最好通过使用 ulimit -n xx 修改每个进程可打开的文件数，缺省值是 1024。
     ulimit -n 4096 将每个进程可以打开的文件数目加大到4096，缺省为1024
     其他建议设置成无限制（unlimited）的一些重要设置是：
     [...]]]></description>
			<content:encoded><![CDATA[<p>ulimit -a 用来显示当前的各种用户进程限制。<br />
    Linux对于每个用户，系统限制其最大进程数。为提高性能，可以根据设备资源情况，<br />
    设置各linux 用户的最大进程数，下面我把某linux用户的最大进程数设为10000个：<br />
     ulimit -u 10000<br />
     对于需要做许多 socket 连接并使它们处于打开状态的 Java 应用程序而言，<br />
     最好通过使用 ulimit -n xx 修改每个进程可打开的文件数，缺省值是 1024。<br />
     ulimit -n 4096 将每个进程可以打开的文件数目加大到4096，缺省为1024<br />
     其他建议设置成无限制（unlimited）的一些重要设置是：<br />
     数据段长度：ulimit -d unlimited<br />
     最大内存大小：ulimit -m unlimited<br />
     堆栈大小：ulimit -s unlimited<br />
     CPU 时间：ulimit -t unlimited<br />
     虚拟内存：ulimit -v unlimited<br />
　　<br />
     暂时地，适用于通过 ulimit 命令登录 shell 会话期间。<br />
     永久地，通过将一个相应的 ulimit 语句添加到由登录 shell 读取的文件中， 即特定于 shell 的用户资源文件，如：</p>
<p>1)、解除 Linux 系统的最大进程数和最大文件打开数限制：<br />
        vi /etc/security/limits.conf<br />
        # 添加如下的行<br />
        * soft noproc 11000<br />
        * hard noproc 11000<br />
        * soft nofile 4100<br />
        * hard nofile 4100</p>
<p>       说明：* 代表针对所有用户<br />
                    noproc 是代表最大进程数<br />
                    nofile 是代表最大文件打开数<br />
2)、让 SSH 接受 Login 程式的登入，方便在 ssh 客户端查看 ulimit -a 资源限制：<br />
        a、vi /etc/ssh/sshd_config<br />
             把 UserLogin 的值改为 yes，并把 # 注释去掉<br />
        b、重启 sshd 服务：<br />
              /etc/init.d/sshd restart<br />
3)、修改所有 linux 用户的环境变量文件：<br />
vi /etc/profile<br />
ulimit -u 10000<br />
ulimit -n 4096<br />
ulimit -d unlimited<br />
ulimit -m unlimited<br />
ulimit -s unlimited<br />
ulimit -t unlimited<br />
ulimit -v unlimited</p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2009/12/09/linux-ulimit-%e5%91%bd%e4%bb%a4%e8%bd%ac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux ipcs 命令</title>
		<link>http://houbolin.cn/blog/2009/12/09/linux-ipcs-%e5%91%bd%e4%bb%a4/</link>
		<comments>http://houbolin.cn/blog/2009/12/09/linux-ipcs-%e5%91%bd%e4%bb%a4/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:14:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=43</guid>
		<description><![CDATA[ipcs &#8211; 分析消息队列、共享内存和信号量 
它的语法：
ipcs [-mqs] [-abcopt] [-C core] [-N namelist]
-m 输出有关共享内存(shared memory)的信息
-q 输出有关信息队列(message queue)的信息
-s 输出信号量(semaphore)的信息
# ipcs -m
IPC status from as of 2007年04月10日 星期二 18时32分18秒 CST
T ID KEY MODE OWNER GROUP
Shared Memory:
m 0 0&#215;50000d43 &#8211;rw-r&#8211;r&#8211; root root
m 501 0&#215;1e90c97c &#8211;rw-r&#8212;&#8211; oracle dba
ipcrm &#8211; 删除ipc(清除共享内存信息)
引用
它的语法：
ipcrm -m&#124;-q&#124;-s shm_id
-m 输出有关共享内存(shared memory)的信息
-q 输出有关信息队列(message queue)的信息
-s 输出信号量(semaphore)的信息
shm_id 共享内存id
#ipcrm -m 501
ipcs用于显示消息队列、共享内存、信号灯信息的
q 显示消息队列
s 显示信号灯
m [...]]]></description>
			<content:encoded><![CDATA[<p>ipcs &#8211; 分析消息队列、共享内存和信号量 </p>
<p>它的语法：</p>
<p>ipcs [-mqs] [-abcopt] [-C core] [-N namelist]<br />
-m 输出有关共享内存(shared memory)的信息<br />
-q 输出有关信息队列(message queue)的信息<br />
-s 输出信号量(semaphore)的信息<br />
# ipcs -m<br />
IPC status from as of 2007年04月10日 星期二 18时32分18秒 CST<br />
T ID KEY MODE OWNER GROUP<br />
Shared Memory:<br />
m 0 0&#215;50000d43 &#8211;rw-r&#8211;r&#8211; root root<br />
m 501 0&#215;1e90c97c &#8211;rw-r&#8212;&#8211; oracle dba</p>
<p>ipcrm &#8211; 删除ipc(清除共享内存信息)<br />
引用<br />
它的语法：<br />
ipcrm -m|-q|-s shm_id<br />
-m 输出有关共享内存(shared memory)的信息<br />
-q 输出有关信息队列(message queue)的信息<br />
-s 输出信号量(semaphore)的信息<br />
shm_id 共享内存id<br />
#ipcrm -m 501</p>
<p>ipcs用于显示消息队列、共享内存、信号灯信息的<br />
q 显示消息队列<br />
s 显示信号灯<br />
m 显示共享内存<br />
a 详细信息</p>
<p>其打印出当前你的系统中处于活动状态的共享内存的信息。</p>
<p>对每一个资源，这个命令会显示：</p>
<p>TYPE 　　　　　　　包括信息队列（q），共享内存段（m),或者信号灯（s)。</p>
<p>ID 　　　　　　　　资源条目的唯一的表示号</p>
<p>KEY　　　　　　　　应用程序存取资源使用的参数。</p>
<p>MODE 　　　　　　　存取模式和许可权限的标记</p>
<p>OWNER and GROUP 　 登录名和用户属主的组号，OnLine使用的所有的共享内存资源的属主的属主　　　　　　　　　 为root和informix组。</p>
<p>OnLine共享内存使用的基本键值为0&#215;52564801。SERVERNUM的值乘上0X10000并且加上这个值就为共享内存的键值。这就是，如果你的SERVERNUM的值为2，你的共享内存段的键值为0&#215;52564801+(2*0&#215;10000)=0&#215;52584801。如果 SERVERNUM的值为6，产生的键值就为0&#215;525c4801。 </p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2009/12/09/linux-ipcs-%e5%91%bd%e4%bb%a4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>linux 下screen命令（转）</title>
		<link>http://houbolin.cn/blog/2009/12/03/linux-%e4%b8%8bscreen%e5%91%bd%e4%bb%a4/</link>
		<comments>http://houbolin.cn/blog/2009/12/03/linux-%e4%b8%8bscreen%e5%91%bd%e4%bb%a4/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 02:22:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux系统命令]]></category>

		<guid isPermaLink="false">http://houbolin.cn/blog/?p=11</guid>
		<description><![CDATA[screen其实就是linux虚拟终端，你可以用它创建很多虚拟终端，每个终端可以创建1~10个窗口，每个窗口相当于一个linux shell窗口，可以执行的操作和正常shell完全一样。]]></description>
			<content:encoded><![CDATA[<p>screen其实就是linux虚拟终端，你可以用它创建很多虚拟终端，每个终端可以创建1~10个窗口，每个窗口相当于一个linux shell窗口，可以执行的操作和正常shell完全一样。</p>
<p><strong style="color: #000102;"><span style="font-weight: normal; font-family: 黑体;">Ctrl-a c         新建 bash screen 终端</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a &#8221;         列出</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a A         重命名</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a n         在当前窗口中切换到下一个 screen 终端</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a p         在当前窗口中切换到上一个 screen 终端<br />
</span></strong><strong style="color: #000102;"><span style="font-weight: normal; font-family: 黑体;">Ctrl-a 空格      窗口切换</span></strong><br style="font-weight: normal; font-family: 黑体;" /><strong style="color: #000102;"> <span style="font-weight: normal; font-family: 黑体;">Ctrl+a w ：窗口列表</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl+a 0-9 ：在第0个窗口和第9个窗口之间切换</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl+a K(大写) ：关闭当前窗口，并且切换到下一个窗口（当退出最后一个窗口时，该终端自动终止，并且退回到原始shell状态）</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">exit ：关闭当前窗口，并且切换到下一个窗口（当退出最后一个窗口时，该终端自动终止，并且退回到原始shell状态）</span><br style="font-weight: normal; font-family: 黑体;" /> <br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a d         断开所有 screen 终端，返回 screen 执行前状态，但 screen 内所有终端的任务都在执行</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">screen -ls     列出当前用户的所有 screen 实例，包括联接和断开的</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">screen -R &lt;pid&gt;    重新联接到已断开的 screen 实例，如果有多个已断开的 screen 实例，则用 &lt;pid&gt; 区分</span><br style="font-weight: normal; font-family: 黑体;" /> <br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a S         新建水平分割窗口</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a Tab     切换窗口</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a X         关闭当前窗口</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a +         扩大当前窗口，默认增加3行</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a &#8211;         缩小当前窗口，默认减小3行</span><br style="font-weight: normal; font-family: 黑体;" /> <br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a :screen &lt;command&gt;    新建 screen 终端，并运行命令&lt;command&gt;</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a :resize &lt;height&gt;    改变当前窗口高度为&lt;height&gt;</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a :quit              退出 screen，将关闭所有 screen 终端，结束其中所有任务</span><br style="font-weight: normal; font-family: 黑体;" /> <br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a &lt;Esc&gt;        进入选择模式</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;PageUp&gt; 或 Ctrl-u      光标上移一页</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;PageDown&gt; 或 Ctrl-d    光标下移一页 </span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Left&gt;  或 h        光标左移一格</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Down&gt; 或 j         光标下移一行</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Up&gt; 或 k           光标上移一行</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Right&gt; 或 l        光标右移一格</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Space&gt;             选择开始，选择结束</span><br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">&lt;Esc&gt;               退出选择模式</span><br style="font-weight: normal; font-family: 黑体;" /> <br style="font-weight: normal; font-family: 黑体;" /> <span style="font-weight: normal; font-family: 黑体;">Ctrl-a ]             粘贴选择的内容</span></strong></p>
<p><strong>【友情提醒】</strong></p>
<p>.screenrc，仅供参考。<br />
<pre>#
# ~/.screenrc
#

# 启动时不显示欢迎屏幕
startup_message off

#  定义screen的功能键为Ctrl-Z。向终端输入Ctrl-Z时应按 Ctrl-Z z。
escape ^Zz

# 屏幕缓冲区 1024 行。
defscrollback 1024

# 在最下一行显示窗口列表和时钟
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "

# 关闭错误提示
vbell off

# 按 Ctrl-Z w 或 Ctrl-Z Ctrl-W 显示窗口列表
bind w windowlist -b</pre><br />
<strong>常用快捷键</strong></p>
<p>注：这些快捷键都需要在按完 escape 键之后使用。默认的escape键是 Ctrl-A，上面贴出的 .screenrc 中将其改成了 Ctrl-Z。例如 <strong>d</strong>，实际操作时应当按 Ctrl-Z d。</p>
<div>
<table border="0" cellspacing="1">
<tbody>
<tr>
<td>快捷键</td>
<td>功能</td>
</tr>
<tr>
<td>d</td>
<td>中断当前会话，下次可以用 screen -r 命令恢复</td>
</tr>
<tr>
<td>c</td>
<td>开新窗口</td>
</tr>
<tr>
<td>0-9数字</td>
<td>在窗口0-窗口9之间迅速切换</td>
</tr>
<tr>
<td>n</td>
<td>下一个窗口</td>
</tr>
<tr>
<td>p</td>
<td>上一个窗口</td>
</tr>
<tr>
<td>S</td>
<td>分割屏幕</td>
</tr>
<tr>
<td>TAB</td>
<td>在分割的屏幕之间切换</td>
</tr>
<tr>
<td>X</td>
<td>关闭分割出的屏幕</td>
</tr>
<tr>
<td>[</td>
<td>进入复制模式，用hjkl移动光标，空格选中开始点，再次按空格选择结束点，进行复制</td>
</tr>
<tr>
<td>]</td>
<td>粘贴</td>
</tr>
<tr>
<td>?</td>
<td>帮助</td>
</tr>
<tr>
<td>:</td>
<td>进入screen的命令行</td>
</tr>
</tbody>
</table>
</div>
<p>另外要提到的<strong>几个常用技巧</strong>：</p>
<ol style="padding-left: 16px; margin-left: 16px;">
<li>重复 escape 键可以在当前窗口与上一个窗口之间迅速切换。例如从窗口1按^Z3切换到窗口3，之后可以按^Z^Z在窗口1和3之间切换。</li>
<li>窗口分割的用法：首先按^ZS（S要大写）进行分割，然后用^Z&lt;TAB&gt;切换到分割出的新屏幕，再用^Z&lt;数字&gt;在新屏幕内切换窗口。结束分割可以用^ZX。</li>
<li>翻页：用了screen之后就不能用平常的 Shift-PageUp 和 Shift-PageDown 来翻页。可以按 ^Z[ 进入复制模式，即可利用与 vi 相同的快捷键来翻页查看历史。最后按Esc取消复制模式。</li>
</ol>
<p><strong>关于 escape 键的选择</strong>：</p>
<p>默认的Ctrl-A与vi的增1功能冲突。如果你不幸习惯了Ctrl-A，那么当你在没有screen的环境下使用vim时，你会在不经意之间按下Ctrl-A而改变附近的数字。因此最好改成别的键。</p>
<p>常用的screen快捷键都在左手，因此escape应当放在键盘的左面三列。Ctrl-Q和Ctrl-S被终端使用无法绑定，Ctrl-` screen不支持，Ctrl-W与vim的切换窗口命令冲突，Ctrl-D与vim的翻页冲突， Ctrl-X与vim的减1功能冲突，Ctrl-E与vim的滚屏冲突，Ctrl-C为很常用的中止程序。因此只能用Ctrl-Z了。Ctrl-Z用于暂 停程序，不常用，可以将其设置为screen的escape键。需要暂停程序时按 Ctrl-Z z 即可。</p>
<p><span style="background-color: #ededff;"><span style="font-family: Courier New;"><br />
</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://houbolin.cn/blog/2009/12/03/linux-%e4%b8%8bscreen%e5%91%bd%e4%bb%a4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

