<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Klu2008's Weblog</title>
	<atom:link href="http://klu2008.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://klu2008.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 03 Jan 2010 18:57:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='klu2008.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Klu2008's Weblog</title>
		<link>http://klu2008.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://klu2008.wordpress.com/osd.xml" title="Klu2008&#039;s Weblog" />
	<atom:link rel='hub' href='http://klu2008.wordpress.com/?pushpress=hub'/>
		<item>
		<title>cmd.exe: change codepage (character encoding)</title>
		<link>http://klu2008.wordpress.com/2010/01/03/cmd-exe-change-codepage-character-encoding/</link>
		<comments>http://klu2008.wordpress.com/2010/01/03/cmd-exe-change-codepage-character-encoding/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 18:57:11 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[cmd.exe]]></category>
		<category><![CDATA[codepage]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/?p=167</guid>
		<description><![CDATA[command chcp is used to change current cmd window&#8217;s charset. chcp w/o argument shows the currently used charset. chcp 65001 is utf-8 Reference: http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using Activating UTF-8 in Windows Console: CHCP<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=167&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>command chcp is used to change current cmd window&#8217;s charset. chcp w/o argument shows the currently used charset.</p>
<p>chcp 65001 is utf-8</p>
<p>Reference:</p>
<p><a href="http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using">http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using</a></p>
<p><a href="http://www.digitalmars.com/d/archives/digitalmars/D/13971.html">Activating UTF-8 in Windows Console: CHCP</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=167&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2010/01/03/cmd-exe-change-codepage-character-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://klu2008.wordpress.com/2009/02/17/164/</link>
		<comments>http://klu2008.wordpress.com/2009/02/17/164/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 19:51:49 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/?p=164</guid>
		<description><![CDATA[Try latex:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=164&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Try latex:</p>
<p><img src='http://s0.wp.com/latex.php?latex=e%3Dmc%5E2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='e=mc^2' title='e=mc^2' class='latex' /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=164&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2009/02/17/164/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>C++入门基础：用传引用给const取代传值</title>
		<link>http://klu2008.wordpress.com/2008/11/13/c%e5%85%a5%e9%97%a8%e5%9f%ba%e7%a1%80%ef%bc%9a%e7%94%a8%e4%bc%a0%e5%bc%95%e7%94%a8%e7%bb%99const%e5%8f%96%e4%bb%a3%e4%bc%a0%e5%80%bc/</link>
		<comments>http://klu2008.wordpress.com/2008/11/13/c%e5%85%a5%e9%97%a8%e5%9f%ba%e7%a1%80%ef%bc%9a%e7%94%a8%e4%bc%a0%e5%bc%95%e7%94%a8%e7%bb%99const%e5%8f%96%e4%bb%a3%e4%bc%a0%e5%80%bc/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:58:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/11/13/c%e5%85%a5%e9%97%a8%e5%9f%ba%e7%a1%80%ef%bc%9a%e7%94%a8%e4%bc%a0%e5%bc%95%e7%94%a8%e7%bb%99const%e5%8f%96%e4%bb%a3%e4%bc%a0%e5%80%bc/</guid>
		<description><![CDATA[[日期：2008-11-13] 来源：Linuxidc.com C++社区&#160; 作者：C++编辑original post: http://www.linuxidc.com/Linux/2008-11/17281.htm &#160;&#160; 缺省情况下，C++ 以传值方式将对象传入或传出函数（这是一个从 C 继承来的特性）。除非你特别指定其它方式，否则函数的参数就会以实际参数（actual argument）的拷贝进行初始化，而函数的调用者会收到函数返回值的一个拷贝。这个拷贝由对象的拷贝构造函数生成。这就使得传值（pass-by- value）成为一个代价不菲的操作。例如，考虑下面这个类层级结构： &#160;class Person {　 public:　　 Person(); // parameters omitted for simplicity　　 virtual ~Person(); // see Item 7 for why this is virtual　　 &#8230; 　 private:　　 std::string name;　　 std::string address; }; class Student: public Person {　 public:　　 Student(); // parameters again omitted　　 ~Student();　　 &#8230; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=159&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><i>[日期：2008-11-13] 			来源：Linuxidc.com C++社区&nbsp; 作者：C++编辑<br />original post: <a href="http://www.linuxidc.com/Linux/2008-11/17281.htm">http://www.linuxidc.com/Linux/2008-11/17281.htm</a></i></p>
<p>&nbsp;&nbsp; 缺省情况下，C++ 以传值方式将对象传入或传出函数（这是一个从 C 继承来的特性）。除非你特别指定其它方式，否则函数的参数就会以实际参数（actual argument）的拷贝进行初始化，而函数的调用者会收到函数返回值的一个拷贝。这个拷贝由对象的拷贝构造函数生成。这就使得传值（pass-by- value）成为一个代价不菲的操作。例如，考虑下面这个类层级结构： <br /> <br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&nbsp;class Person {<br />　 public:<br />　　 Person(); // parameters omitted for simplicity<br />　　 virtual ~Person(); // see Item 7 for why this is virtual<br />　　 &#8230;</p>
<p>　 private:<br />　　 std::string name;<br />　　 std::string address;<br /> };</p>
<p>class Student: public Person {<br />　 public:<br />　　 Student(); // parameters again omitted<br />　　 ~Student();<br />　　 &#8230;</p>
<p>　 private:<br />　　 std::string schoolName;<br />　　 std::string schoolAddress;<br />};</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 现在，考虑以下代码，在此我们调用一个函数―― validateStudent，它得到一个 Student 参数（以传值的方式），并返回它是否验证有效的结果：<br /> <br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>bool validateStudent(Student s); // function taking a Student<br />// by value</p>
<p>Student plato; // Plato studied under Socrates</p>
<p>bool platoIsOK = validateStudent(plato); // call the function</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 当这个函数被调用时会发生什么呢？</p>
<p>　 　很明显，Student 的拷贝构造函数被调用，用 plato 来初始化参数 s。同样明显的是，当 validateStudent 返回时，s 就会被销毁。所以这个函数的参数传递代价是一次 Student 的拷贝构造函数的调用和一次 Student 的析构函数的调用。</p>
<p>　　 但这还不是全部。一个 Student 对象内部包含两个 string 对象，所以每次你构造一个 Student 对象的时候，你也必须构造两个 string 对象。一个 Student 对象还要从一个 Person 对象继承，所以每次你构造一个 Student 对象的时候，你也必须构造一个 Person 对象。一个 Person 对象内部又包含两个额外的 string 对象，所以每个 Person 的构造也承担着另外两个 string 的构造。最终，以传值方式传递一个 Student 对象的后果就是引起一次 Student 的拷贝构造函数的调用，一次 Person 的拷贝构造函数的调用，以及四次 string 的拷贝构造函数调用。当 Student 对象的拷贝被销毁时，每一个构造函数的调用都对应一个析构函数的调用，所以以传值方式传递一个 Student 的全部代价是六个构造函数和六个析构函数！</p>
<p>　　好了，这是正确的和值得的行为。毕竟，你希望你的全部对象都得到可靠的初始化和销毁。尽管如此，如果有一种办法可以绕过所有这些构造和析构过程，应该变得更好，这就是：传引用给 const（pass by&nbsp;&nbsp; reference-to-const）：</p>
<p>bool validateStudent(const Student&amp; s);</p>
<p>　 　这样做非常有效：没有任何构造函数和析构函数被调用，因为没有新的对象被构造。被修改的参数声明中的 const 是非常重要的。 validateStudent 的最初版本接受一个 Student 值参数，所以调用者知道它们屏蔽了函数对它们传入的 Student 的任何可能的改变；validateStudent 也只能改变它的一个拷贝。现在 Student 以引用方式传递，同时将它声明为 const 是必要的，否则调用者必然担心 validateStudent 改变了它们传入的 Student。</p>
<p>　　以传引用方式传递参数还可以避 免切断问题（slicing problem）。当一个派生类对象作为一个基类对象被传递（传值方式），基类的拷贝构造函数被调用，而那些使得对象的行为像一个派生类对象的特殊特性被 &#8220;切断&#8221;了。你只剩下一个纯粹的基类对象――这没什么可吃惊的，因为是一个基类的构造函数创建了它。这几乎绝不是你希望的。例如，假设你在一组实现一个图 形窗口系统的类上工作：<br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&nbsp;class Window {<br />　 public:<br />　　 &#8230;<br />　　 std::string name() const; // return name of window<br />　　 virtual void display() const; // draw window and contents<br />};</p>
<p>class WindowWithScrollBars: public Window {<br /> 　 public:<br />　　 &#8230;<br />　　 virtual void display() const;<br />};</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 所有 Window 对象都有一个名字，你能通过 name 函数得到它，而且所有的窗口都可以显示，你可一个通过调用 display 函数来做到这一点。display 为 virtual 的事实清楚地告诉你：一个纯粹的基类的 Window 对象的显示方法有可能不同于专门的 WindowWithScrollBars 对象的显示方法。</p>
<p>　　现在，假设你想写一个函数打印出一个窗口的名字，并随后显示这个窗口。以下这个函数的写法是错误的：<br /> <br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&nbsp;void printNameAndDisplay(Window w) // incorrect! parameter<br />{ <br />　 // may be sliced!<br />　 std::cout &lt;&lt; <a href="http://w.name">w.name</a>();<br />　 w.display();<br />}</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 考虑当你用一个 WindowWithScrollBars 对象调用这个函数时会发生什么：<br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&nbsp;WindowWithScrollBars wwsb;</p>
<p>printNameAndDisplay(wwsb);</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 参数 w 将被作为一个 Window 对象构造――它是被传值的，记得吗？而且使 wwsb 表现得像一个 WindowWithScrollBars 对象的特殊信息都被切断了。在 printNameAndDisplay 中，全然不顾传递给函数的那个对象的类型，w 将始终表现得像一个 Window 类的对象（因为它就是一个 Window 类的对象）。特别是，在 printNameAndDisplay 中调用 display 将总是调用 Window：：display，绝不会是 WindowWithScrollBars：：display.</p>
<p>&nbsp;&nbsp;&nbsp; 绕过切断问题的方法就是以传引用给 const 的方式传递 w：<br />
<table bgcolor="#ffffff" border="2" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&nbsp;void printNameAndDisplay(const Window&amp; w) // fine, parameter won&#8217;t<br />{<br />　 // be sliced<br />　 std::cout &lt;&lt; <a href="http://w.name">w.name</a>();<br />　 w.display();<br />}</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;&nbsp; 现在 w 将表现得像实际传入的那种窗口。</p>
<p>&nbsp;&nbsp;&nbsp; 如果你掀开编译器的盖头偷看一下，你会发现用指针实现引用是非常典型的做法，所以以引用传递某物实际上通常意味着传递一个指针。由此可以得出结论，如果你 有一个内建类型的对象（例如，一个 int），以传值方式传递它常常比传引用方式更高效。那么，对于内建类型，当你需要在传值和传引用给 const 之间做一个选择时，没有道理不选择传值。同样的建议也适用于 STL 中的迭代器（iterators）和函数对象（function objects），因为，作为惯例，它们就是为传值设计的。迭代器（iterators）和函数对象（function objects）的实现有责任保证拷贝的高效并且不受切断问题的影响。（这是一个&#8221;规则如何变化，依赖于你使用 <font color="#0000ff">C++</font> 的哪一个部分&#8221;的实例。）</p>
<p>&nbsp;&nbsp;&nbsp; 内建类型很小，所以有人就断定所有的小类型都是传值的上等候选者，即使它们是用户定义的。这样的推论是不可靠的。仅仅因为一个对象小，并不意味着调用它的 拷贝构造函数就是廉价的。很多对象――大多数 STL 容器也在其中――容纳的和指针一样，但是拷贝这样的对象必须同时拷贝它们指向的每一样东西。那可能是非常昂贵的。</p>
<p>&nbsp;&nbsp;&nbsp; 即使当一个小对象有一个廉价的拷贝构造函数，也会存在性能问题。一些编译器对内建类型和用户定义类型并不一视同仁，即使他们有同样的底层表示。例如，一些 编译器拒绝将仅由一个 double 组成的对象放入一个寄存器中，即使在常规上它们非常愿意将一个纯粹的 double 放入那里。如果发生了这种事情，你以传引用方式传递这样的对象更好一些，因为编译器理所当然会将一个指针（引用的实现）放入寄存器。</p>
<p>&nbsp;&nbsp;&nbsp; 小的用户定义类型不一定是传值的上等候选者的另一个原因是：作为用户定义类型，它的大小常常变化。一个现在较小的类型在将来版本中可能变得更大，因为它的 内部实现可能会变化。甚至当你换了一个不同的 C++ 实现时，事情都可能会变化。例如，就在我这样写的时候，一些标准库的 string 类型的实现的大小就是另外一些实现的七倍。</p>
<p>&nbsp;&nbsp;&nbsp; 通常情况下，你能合理地假设传值廉价的类型仅有内建类型及 STL 中的迭代器和函数对象类型。对其他任何类型，请遵循本 Item 的建议，并用传引用给 const 取代传值。</p>
<p>&nbsp;&nbsp;&nbsp; Things to Remember</p>
<p>&nbsp;&nbsp;&nbsp; 。用传引用给 const 取代传值。典型情况下它更高效而且可以避免切断问题。</p>
<p> &nbsp;&nbsp;&nbsp; 。这条规则并不适用于内建类型及 STL 中的迭代器和函数对象类型。对于它们，传值通常更合适。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=159&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/11/13/c%e5%85%a5%e9%97%a8%e5%9f%ba%e7%a1%80%ef%bc%9a%e7%94%a8%e4%bc%a0%e5%bc%95%e7%94%a8%e7%bb%99const%e5%8f%96%e4%bb%a3%e4%bc%a0%e5%80%bc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>const in C/C++</title>
		<link>http://klu2008.wordpress.com/2008/10/02/const-in-cc/</link>
		<comments>http://klu2008.wordpress.com/2008/10/02/const-in-cc/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 14:31:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/10/02/const-in-cc/</guid>
		<description><![CDATA[/*********************&#160;*&#160;&#160;&#160; POINTER ISSUE&#160; * &#160;*********************//* &#160;* const int and int const is the same:&#160;*/ &#160; const int a = 0;&#160; int const a2 = 0;&#160;&#160;&#160; // this format is better. &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // it&#39;s consistent with the following:&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //&#160;&#160; int * const pi = &#38;a; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Because const is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=158&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr"><span style="font-family:courier new,monospace;">/*********************</span><br /><span style="font-family:courier new,monospace;">&nbsp;*&nbsp;&nbsp;&nbsp; POINTER ISSUE&nbsp; *</span><br />  <span style="font-family:courier new,monospace;">&nbsp;*********************/</span><br /><span style="font-family:courier new,monospace;">/* </span><br />  <span style="font-family:courier new,monospace;">&nbsp;* const int and int const is the same:</span><br /><span style="font-family:courier new,monospace;">&nbsp;*/</span><br />  <span style="font-family:courier new,monospace;">&nbsp; const int a = 0;</span><br /><span style="font-family:courier new,monospace;">&nbsp; int const a2 = 0;&nbsp;&nbsp;&nbsp; // this format is better.</span><br />  <span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // it&#39;s consistent with the following:</span><br /><span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; int * const pi = &amp;a;</span><br />  <span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Because const is applied directly on the variable</span></p>
<p><span style="font-family:courier new,monospace;">/*</span><br />  <span style="font-family:courier new,monospace;">&nbsp;* const pointer issue:</span><br /><span style="font-family:courier new,monospace;">&nbsp;*/</span><br />  <span style="font-family:courier new,monospace;">&nbsp; const int * pa = &amp;a; // pa points to a const int</span><br /><span style="font-family:courier new,monospace;">&nbsp; int const * pa2 = &amp;a; // same as above</span><br />  <span style="font-family:courier new,monospace;">&nbsp; const int * const cpa = &amp;a; // cpa itself is a const pointer </span><br /><span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // its value can&#39;t be changed</span></p>
<p><span style="font-family:courier new,monospace;">/***********************</span><br /><span style="font-family:courier new,monospace;">&nbsp;*&nbsp;&nbsp; REFERENCE ISSUE&nbsp;&nbsp; *</span><br />  <span style="font-family:courier new,monospace;">&nbsp;***********************/</span><br /><span style="font-family:courier new,monospace;">/*</span><br />  <span style="font-family:courier new,monospace;">&nbsp;* reference to a value, or to a expression, </span><br /><span style="font-family:courier new,monospace;">&nbsp;* or to another type must be const:</span><br />  <span style="font-family:courier new,monospace;">&nbsp;*/</span><br /><span style="font-family:courier new,monospace;">double d = 2.0;</span><br />  <span style="font-family:courier new,monospace;">const int &amp; i = d; // correct</span><br /><span style="font-family:courier new,monospace;">int const &amp; i2 =d; // correct</span></p>
<p><span style="font-family:courier new,monospace;">int const &amp; i3 = 5; // correct</span></p>
<p>  <span style="font-family:courier new,monospace;">int a2 = 0;</span><br /><span style="font-family:courier new,monospace;">int const &amp; i4 = a2 + 1; // correct, a2+1 is a tmp value</span><br />  <span style="font-family:courier new,monospace;">int const * &amp; a2r = &amp;a2; // correct, because &amp;a2 stores in a tmp place</span><br /><span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// so its reference must be const, in this case,</span><br />  <span style="font-family:courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// it&#39;s a const pointer to int</span></p>
<p><span style="font-family:courier new,monospace;">/*</span><br />  <span style="font-family:courier new,monospace;">&nbsp;* const can&#39;t be applied on a reference variable:</span><br /><span style="font-family:courier new,monospace;">&nbsp;*/</span><br />  <span style="font-family:courier new,monospace;">int &amp; const i3 = d; // WRONG !!!</span> </div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=158&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/10/02/const-in-cc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>Life in Text Mode</title>
		<link>http://klu2008.wordpress.com/2008/09/04/life-in-text-mode/</link>
		<comments>http://klu2008.wordpress.com/2008/09/04/life-in-text-mode/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 20:00:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/04/life-in-text-mode/</guid>
		<description><![CDATA[(Original post: http://aperiodic.net/phil/archives/Geekery/text-mode-guerrilla.html) I primarily use Unix-based computers, mostly Linux. On those computers, I live in text mode. This entry is an attempt to document the software I find most useful to my text-mode guerrilla lifestyle. Included are links to the programs I rely on, links to alternative programs, and links to my config files. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=157&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">
<p><i>(Original post: <a href="http://aperiodic.net/phil/archives/Geekery/text-mode-guerrilla.html">http://aperiodic.net/phil/archives/Geekery/text-mode-guerrilla.html</a>)</i></p>
<p>I primarily use Unix-based computers, mostly Linux.  On those computers, I live in text mode.  This entry is an attempt to document the software I find most useful to my text-mode guerrilla lifestyle.  Included are links to the programs I rely on, links to alternative programs, and links to my config files.</p>
<p><a href="http://www.gnu.org/software/screen/">screen</a> (<a href="http://aperiodic.net/phil/configs/screenrc">.screenrc</a>, <a href="http://aperiodic.net/phil/configs/screenrc-mithrandir">.screenrc-mithrandir</a>). Simply indispensable.  It slices and dices console sessions.  Pretty much everything I do, I do in screen.  For extensive details, see my <a href="http://aperiodic.net/phil/archives/Geekery/ode-to-screen.html">ode to screen</a>.</p>
<p><a href="http://www.zsh.org/">zsh</a> (<a href="http://aperiodic.net/phil/configs/zshrc">.zshrc</a>, <a href="http://aperiodic.net/phil/configs/zshenv">.zshenv</a>, <a href="http://aperiodic.net/phil/configs/zshprompt">.zshprompt</a>). My shell of choice.  Think of all the good features of bash, ksh, and tcsh rolled together.  (Without much of the ickiness, particularly the csh heritage.)  Personally, the killer application of zsh was that fact that not only did it have context-sensitive completion but (unlike tcsh) it shipped with hordes of completion definitions right out of the box.  Type &#39;<code>dpkg -L fo&lt;tab&gt;</code>&#39; and zsh will autocomplete on the Debian packages currently installed on your system.  With an ssh-agent running, type &#39;<code>scp otherhost:fo&lt;tab&gt;</code>&#39; and zsh will ssh to the other system and autocomplete on the files available on that host.</p>
<p><a href="http://www.irssi.org/">irssi</a> (<a href="http://aperiodic.net/phil/configs/irssi/config">config</a>, <a href="http://aperiodic.net/phil/configs/irssi/phil.theme">theme</a>). The best IRC client I&#39;ve come across, certainly beating out IrcII, BitchX, and even epic.  Multiple windows, extensible, tons of plugins available.</p>
<p><a href="http://www.bitlbee.org/">bitlbee</a>.  This is actually an IRC-to-Instant-Messaging gateway.  It allows me to use AIM, Jabber, and the like from within my preferred chat program, irssi.</p>
<p><a href="http://home.kcore.de/%7Ekiza/software/snownews/">snownews</a>. curses-based RSS aggregator.  I shopped around a bit before finding an aggregator that I liked.  snownews does everything I need.</p>
<p><a href="http://www.mutt.org/">mutt</a> (<a href="http://aperiodic.net/phil/configs/muttrc">.muttrc</a>, <a href="http://aperiodic.net/phil/configs/mutt">config directory</a>). Possibly the best mail client around, GUI or not.  While <a href="http://www.washington.edu/pine/">pine</a> is okay (and simpler to use), mutt is much more customizable and scales better to large volumes of email.</p>
<p><a href="http://www.procmail.org/">procmail</a> (<a href="http://aperiodic.net/phil/configs/procmailrc">.procmailrc</a>). Slices and dices my email.  I have procmail rewriting things so they&#39;re easier for me to deal with, sorting my list mail into separate mailboxes (automatically; no need to add new lists by hand), and checking (and dealing with) spam.  Essential to my email usage.</p>
<p><a href="http://www.gnu.org/software/emacs/emacs.html">Emacs</a> (<a href="http://aperiodic.net/phil/configs/emacs">.emacs</a>). My text editor of choice.  Feel free to substitute <a href="http://www.xemacs.org/">XEmacs</a> or vi (preferably <a href="http://www.vim.org/">vim</a>) at your own preference.  I prefer emacs to vi, though I know a decent amount of vi, as any sysadmin should. I actually like XEmacs a little better than GNU Emacs, but GNU Emacs has better UTF-8 support.</p>
<p><a href="http://w3m.sourceforge.net/">w3m</a>.  Web browser.  Among other things, w3m does tabbed browsing, though it&#39;s not multithreaded, so you can&#39;t read one tab while another is loading.  It even has image support; run it with a valid $DISPLAY and it&#39;ll render images on the page.  There are other text-mode browsers, most notably <a href="http://links.sourceforge.net/">links</a>.  I&#39;m not tremendously familiar with links because w3m fills all of my needs.  (My original decision between the two came about because w3m had better HTML support, but I don&#39;t believe this is any longer the case.)  The grandaddy of text-mode browsers is, of course, <a href="http://lynx.browser.org/">lynx</a>, but it&#39;s lagged far behind w3m and links in support for newer aspects of HTML.</p>
<p><a href="http://www.nanoo.org/%7Edaniel/moosic/">moosic</a> (<a href="http://aperiodic.net/phil/configs/moosic/config-mithrandir">config</a>). This is a music jukebox.  The features that distinguish it from other such programs are twofold.  First, it runs as a standalone server; you interact with it via a command line client.  (In theory, a curses or GUI client could be written, but to my knowledge none yet has.) Second, it&#39;s customizable with regards to how it plays music.  It has a config file where you tell it what programs to use to play various music formats (it does come with reasonable defaults).  A program with similar design is <a href="http://www.musicpd.org/">mpd</a>.  mpd does its own music playing, which allows some advantages over moosic, but moosic has much better playlist management.</p>
<p><a href="http://www.mplayerhq.hu/homepage/">mplayer</a> (<a href="http://aperiodic.net/phil/configs/mplayer/config">config</a>). Okay, this is kind of a hedge.  I do indeed use it purely in text mode on occasion&#8211;it has better support for streaming media (usually mp3s) than any of the actual mp3 players I use.  mplayer&#39;s main advantage is that it will play pretty much any video format I throw at it.  (I&#39;m not quite masochistic enough to watch the videos in <a href="http://aa-project.sourceforge.net/aalib/">aalib</a>, though.)</p>
<p><a href="http://surfraw.sourceforge.net/">surfraw</a> (<a href="http://aperiodic.net/phil/configs/surfraw.conf">.surfraw.conf</a>). surfraw is a collection of command-line based jumping-points to various web-based information, mostly searches.  For a quick google search, I need only go to a command line and type &#39;<code>sr google <i>my search terms</i></code>&#39;.  (Debian uses a single program, &#39;<code>sr</code>&#39;, as a wrapper for all of the surfraw &quot;elvi&quot;.  On other systems, you would probably just run &#39;<code>google <i>your search terms</i></code>&#39;.)</p>
<p><a href="http://www.gnu.org/software/wget/wget.html">wget</a>.  The swiss-army-knife of grabbing things off the web (and via FTP).  I&#39;ve automated many downloads, some tweaked in interesting ways, with wget.</p>
<p><a href="http://www.rrbcurnow.freeuk.com/tdl/">tdl</a>.  Completely command-line todo list manager.  Along similar lines is <a href="http://swapoff.org/DevTodo">DevTodo</a>; I haven&#39;t really played with it because tdl does everything I need.  Those two are both command-line based.  For more of a todo list editor, you might want to take a look at <a href="http://hnb.sourceforge.net/">hnb</a> or <a href="http://freshmeat.net/projects/woody/">woody</a>.  (Though, of those two, hnb has better support for todo lists.)</p>
<p>Those are the bigger programs that jump to mind most readily.  I use a host of other programs, too.  Listed briefly, they are: <a href="http://www.greenwoodsoftware.com/less/">less</a> (pager), <a href="http://mpg321.sourceforge.net/">mpg321</a> (mp3 player), <a href="http://www.gnupg.org/">GnuPG</a> (OpenPGP implementation) (<a href="http://aperiodic.net/phil/configs/gnupg/options">options</a>), <a href="http://www.jpj.net/%7Etrevor/aumix.html">aumix</a> (volume control), <a href="http://www.tug.org/teTeX/">teTeX</a> (TeX implementation), <a href="http://palcal.sourceforge.net/">pal</a> (nice colored calendar with a number of features), <a href="http://www.gnu.org/software/bc/">bc</a> (simple command line calculator), <a href="http://www.dict.org/links.html">dict</a> (actually a dictionary network protocol but their command-line client is also named &#39;dict&#39;), <a href="http://mp3gain.sourceforge.net/">mp3gain</a> (normalization of mp3s (ideally should be done non-destructively via ID3v2 but no one supports that)), <a href="http://netcat.sourceforge.net/">netcat</a> (connect directly to TCP sockets), <a href="http://bittornado.com/">BitTornado</a> (bittorrent client; slightly nicer than the standard one), <a href="http://subversion.tigris.org/">subversion</a> (source revision control; nicer than <a href="https://www.cvshome.org/">cvs</a>), <a href="http://www.hispalinux.es/%7Edata/abcde.php">abcde</a> (CD ripper) (<a href="http://aperiodic.net/phil/configs/abcde.conf">.abcde.conf</a>), <a href="http://lame.sourceforge.net/">lame</a> (MP3 encoder), <a href="http://www.insecure.org/nmap/">nmap</a> (portscanner), <a href="http://www.hping.org/">hping</a> (packet generator), and <a href="http://www.tcpdump.org/">tcpdump</a> (packet sniffer).</p>
<p>I do normally run X; it lets me have multiple xterms on the screen at once.  For managing those xterms, I run <a href="http://modeemi.cs.tut.fi/%7Etuomov/ion/">ion</a> (<a href="http://aperiodic.net/phil/configs/ion2/">config directory</a>), a tiling window manager.</p>
<p>There are a couple of GUI programs I use regularly.  I&#39;ve already mentioned mplayer; you really need a pixelmapped interface to watch movies.  There&#39;s also <a href="http://www.ethereal.com/">Ethereal</a>, an excellent network sniffer and protocol analyzer (much nicer than plain tcpdump), and <a href="http://www.gnucash.org/">GnuCash</a>, one of the best asset management programs I&#39;ve come across.  (But see <a href="http://clacct.sourceforge.net/">clacct</a> for straight command line checkbook balancing.)  Oh, and <a href="http://www.mozilla.org/products/firefox/">Firefox</a>, for those websites that just won&#39;t work with w3m.</p>
</p></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/157/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/157/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=157&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/04/life-in-text-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux: Essential Command Line Apps For Common Tasks</title>
		<link>http://klu2008.wordpress.com/2008/09/04/linux-essential-command-line-apps-for-common-tasks/</link>
		<comments>http://klu2008.wordpress.com/2008/09/04/linux-essential-command-line-apps-for-common-tasks/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:56:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/04/linux-essential-command-line-apps-for-common-tasks/</guid>
		<description><![CDATA[Whether working on a server or a low end machine, you don&#8217;t want to bog things down even more by running a GUI — plus you need to know how to use the power of Linux and the GUI is just not it. It is possible to accomplish most any task while working from within [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=156&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">
<p><img class="pad" src="http://www.hackosis.com/wp-content/uploads/2007/12/usecli.png" alt="Use the CLI" align="left">Whether working on a server or a low end machine, you don&#8217;t want to bog things down even more by running a GUI — plus you need to know how to use the power of Linux and the GUI is just not it. </p>
<p>It is possible to accomplish most any task while working from within the shell. Having the knowledge of what and how to use the applications that are available is the key to being a successful CLI expert. </p>
<p>The following is a guide for the command line applications needed to work freely from within the Linux terminal. Now get off of your GUI butt, get typing, and <strong>throw your mouse in the trash</strong>.</p>
<div id="code"><em><font color="red">NOTE:</font> Most of the applications listed should be available from the distribution&#8217;s repositories. Options and configurations of applications listed are not covered in detail. <tt>man [cmd]</tt> should be used to explore options not explained here.</em></div>
<p>&nbsp;<br /> <span></span></p>
<h3>Common Accessories</h3>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/cmatrix.png" alt="CMatrix"><br /> <em><font size="1">cmatrix</font></em>
<p><strong>Screen Saver</strong> &#8211; <a href="http://sourceforge.net/projects/cmatrix/">cmatrix</a> &#8211; Console matrix simulator. Use this with the <tt>- s</tt> option for screensaver mode. A must have for geeks.</p>
<p><strong>Search</strong> &#8211; <a href="http://www.gnu.org/software/findutils/">find</a> &#8211; Find is default on most Linux distributions. Syntax is as follows: <tt>find /dir/name -name searchstring</tt> with many other options.</p>
<p><strong>Printing</strong> &#8211; <a href="http://www.gnu.org/software/textutils/textutils.html">cat</a> &#8211; Not the only way to use this command — The easiest way to print from CLI is by using the cat command to redirect the output directly to the printing device: <tt>cat filename | /dev/lpt1</tt></p>
<p><strong>Calculator</strong> &#8211; <a href="http://www.gnu.org/software/bc/">bc</a> &#8211; Execute <tt>bc</tt>, enter your math equation and hit the enter key.</p>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/mc.png" alt="Midnight Commander"><br /> <em><font size="1">Midnight Commander</font></em>
<p><strong>File Management</strong> &#8211; <a href="http://www.ibiblio.org/mc/">Midnight Commander</a> &#8211; <tt>mc</tt> = Best.CLI.based.file.manger.eva Protocols include SMB, FTP, SSH, support along with the ability to browse ZIP and TAR files.</p>
<p><strong>Text Editing and Development</strong> &#8211; nano &#8211; Easy to use text editor and clone of pico. <a href="http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting">Syntax highlighting</a> is also available for various programming languages.</p>
<p><strong>Spell Check</strong> &#8211; <a href="http://www.gnu.org/software/ispell/ispell.html">Ispell</a> &#8211; Spell checking is essential if you care anything about what you write. Syntax is simple <tt>ispell file.txt</tt>.</p>
<p><strong>Calendar</strong> &#8211; <a href="http://www.lightandmatter.com/when/when.html">When</a> &#8211; Very simple and effective calendar program.<br /> &nbsp;</p>
<h3>Internet and File Transfer</h3>
<p><strong>Download Manager</strong> &#8211; <a href="http://www.gnu.org/software/wget/">Wget</a> &#8211; Download manager and mirroring utility. Wget, hands down, is the best download manager for the Linux CLI.</p>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/lynx.png" alt="Lynx"><br /> <em><font size="1">Lynx Web Browser</font></em>
<p><strong>Web Browser</strong> &#8211; <a href="http://lynx.browser.org/">Lynx</a> &#8211; Simple and effective web browsing for command line.</p>
<p><strong>FTP Client</strong> &#8211; <a href="http://www.ncftp.com/">NcFTP</a> &#8211; Offers many enhancements over the classic <tt>ftp</tt> command.</p>
<p><strong>Email Client</strong> &#8211; <a href="http://www.linux.com/articles/58760">Mutt</a> &#8211; Small and powerful email client with ability to use Lynx to read HTML emails.</p>
<p><strong>BitTorrent Client</strong> &#8211; <a href="http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide">rtorrent</a> &#8211; BitTorrent client based on libtorrent.</p>
<p><strong>Chat Client</strong> &#8211; <a href="http://nion.modprobe.de/blog/archives/543-Testing-finch-of-pidgin.html">Finch</a> &#8211; Text based version of the popular multi-client chat program <a href="http://en.wikipedia.org/wiki/Pidgin_%28software%29">Pidgin</a>. It supports the same amount of <a href="http://en.wikipedia.org/wiki/Pidgin_%28software%29#Supported_protocols">protocols</a>.</p>
<p><strong>RSS Reader</strong> &#8211; <a href="http://rss2email.infogami.com/">rss2email</a> &#8211; Automatically converts and sends RSS feeds to a specified email address. Also handles Atom feeds.</p>
<p><strong>Podcatcher</strong> &#8211; <a href="http://lincgeek.org/bashpodder/">BashPodder</a> &#8211; Download your favorite podcasts.</p>
<p><strong>Wifi Management</strong> &#8211; <a href="http://www.kismetwireless.net/">Kismet</a> &#8211; Detects wireless access points, detect hidden access points, and do other things your mom never told you about.<br /> &nbsp;</p>
<h3>Audio</h3>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/mp3blaster.png" alt="MP3Blaster"><br /> <em><font size="1">mp3blaster</font></em>
<p><strong>Audio Player</strong> &#8211; <a href="http://mp3blaster.sourceforge.net/">MP3blaster</a> &#8211; plays OGG, MP3, and WAV files complete with playlists, shuffle, and repeat mode.</p>
<p><strong>Audio Mixer</strong> &#8211; <a href="http://jpj.net/%7Etrevor/aumix.html">aumix</a> &#8211; Scriptable command line audio mixer.</p>
<p><strong>Audio Converter</strong> &#8211; <a href="http://sox.sourceforge.net/Main/HomePage">SoX</a> &#8211; SoX not only supports conversion, but also trimming, effects, and resampling. Known as the swiss army knife for audio files.</p>
<p><strong>Audio Ripper</strong> &#8211; <a href="http://www.hispalinux.es/%7Edata/abcde.php" class="broken_link">A Better CD Encoder</a> &#8211; a.k.a. abcde rips audio CDs to the format that you specify. Abcde supports OGG, MP3, FLAC, SPX, and MPC.<br />  &nbsp;</p>
<h3>Utilities</h3>
<p><strong>PDF Viewer</strong> &#8211; <a href="http://pdftohtml.sourceforge.net/">pdftohtml</a> &#8211; For obvious reasons, reading PDFs in a CLI is not an option. Therefor, PDFs must be converted to a readable format such as HTML or text.</p>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/htop.png" alt="htop"><br /> <em><font size="1">htop</font></em>
<p><strong>Process Manager</strong> &#8211; <a href="http://htop.sourceforge.net/">htop</a> &#8211; htop is similar to top, but with more features such as scrolling of the task list and colors. You need this managing and killing processes, troubleshooting system resource usage, etc.</p>
<p> <img src="http://www.hackosis.com/wp-content/uploads/2007/12/bwm-ng.png" alt="bwm-ng"><br /> <em><font size="1">bwm-ng</font></em>
<p><strong>Bandwidth Monitor</strong> &#8211; <a href="http://www.gropp.org/?id=projects&amp;sub=bwm-ng">bwm-ng</a> &#8211; Next generation of bwm. Simple and effective.</p>
<p><strong>To-do List</strong> &#8211; <a href="https://gna.org/projects/yagtd/">yaGTD</a> &#8211; Getting things done application is perfect for to do lists and prioritization.</p>
<p><strong>File Encryption</strong> &#8211; <a href="http://www.gnupg.org/">GPG</a> &#8211; The GNU Privacy Guard is perfect for encrypting and decrypting sensitive information with a password.</p>
<p><strong>Video Converter</strong> &#8211; <a href="http://www.mplayerhq.hu/design7/news.html">MEncoder</a> &#8211; Included with MPlayer, MEncoder has ability to convert video files between the following common formats: MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, and FLV.</p>
<p><strong>Word File Viewer</strong> &#8211; <a href="http://www.winfield.demon.nl/">Antiword</a> &#8211; tired of everyone emailing .DOC files, don&#8217;t be.</p>
<p>The CLI is fun. If you plan on exploring deeper, check out <a href="http://www.kuro5hin.org/story/2004/3/9/16838/14935">Screen — the terminal multiplexor</a>. There is so much you can do, and it is all at the power of your finger tips. I know that so much was missed in this article — only the most common applications are covered. Thanks to <a href="http://www.google.com/search?hl=en&amp;safe=off&amp;q=site%3Alinux.com+CLI+magic&amp;btnG=Search">Linux.com&#8217;s CLI magic articles</a> and the <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users">Ubuntu users list</a>. <strong>Now you might have a clue how to get around when your X server crashes. </strong></p>
<p>Have a command line application that deserves a spot here? Leave a comment or <a href="http://www.hackosis.com/index.php/contact-me/">email me</a> and I will add it to the list.</p>
<p>UPDATE: I found a similar page on <a href="http://aperiodic.net/phil/archives/Geekery/text-mode-guerrilla.html">aperiodic.net</a> that might interest you.</p>
<p> </div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/156/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/156/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=156&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/04/linux-essential-command-line-apps-for-common-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/usecli.png" medium="image">
			<media:title type="html">Use the CLI</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/cmatrix.png" medium="image">
			<media:title type="html">CMatrix</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/mc.png" medium="image">
			<media:title type="html">Midnight Commander</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/lynx.png" medium="image">
			<media:title type="html">Lynx</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/mp3blaster.png" medium="image">
			<media:title type="html">MP3Blaster</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/htop.png" medium="image">
			<media:title type="html">htop</media:title>
		</media:content>

		<media:content url="http://www.hackosis.com/wp-content/uploads/2007/12/bwm-ng.png" medium="image">
			<media:title type="html">bwm-ng</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux下非常实用的命令行工具</title>
		<link>http://klu2008.wordpress.com/2008/09/04/linux%e4%b8%8b%e9%9d%9e%e5%b8%b8%e5%ae%9e%e7%94%a8%e7%9a%84%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%b7%a5%e5%85%b7/</link>
		<comments>http://klu2008.wordpress.com/2008/09/04/linux%e4%b8%8b%e9%9d%9e%e5%b8%b8%e5%ae%9e%e7%94%a8%e7%9a%84%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%b7%a5%e5%85%b7/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:38:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/04/linux%e4%b8%8b%e9%9d%9e%e5%b8%b8%e5%ae%9e%e7%94%a8%e7%9a%84%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%b7%a5%e5%85%b7/</guid>
		<description><![CDATA[2007-08-01&#160;&#160;作者:bitsCN整理&#160;&#160;来源:中国网管联盟 .Urd463 { display:none; } 　　首先，这是一个确凿的事实，许多IT专 业人士使用Linux命令行，即使在GUI也可用的情况下。嘿，我们的第一个Linux 命令行指南的点击量超过了5万次。但是让我们听一听来自IT专家的理由，在这个案例中，我们倾听来自工程部gotalk高级技术专家David Witham的理由。 网管网www.bitscn.com 　　&#8221;我就靠着命令行为生。命令行给你对你所做的事情和需要完成的事情的最终控制权。如果没有命令来完成的话，你可以编写脚本或者管线来完成。使用 GUI的话，所见即所得。你通常不能再构建你自己的GUI附件了。一个大的好处就是远程访问。使用命令行进行远程访问通常要容易得多，它占用的带宽比终端 服务或者其他的图形化远程访问方式更少。&#8221; 网管下载dl.bitscn.com 　　Joe Klemmer: 网管u家u.bitsCN.com 　　1 expect：&#8221;我使用expect来完成许多通常需要反复执行的需要很多时间的系统管理任务;类似在我的桌面电脑和服务器之间移动文件这样的事情就可以用expect来完成。&#8221; 网管网www.bitscn.com 　　2 lft：&#8221;lft就像是类固醇的追踪路由。你可以获得比追踪路由更多得多的信息，用于调试连接或者只是用来寻找机器或者系统在哪里。&#8221; 网管联盟bitsCN@com 　　3 mc：&#8221;它是最好的文件管理器。自从我在DOS上使用了Norton Commander，从DOS到Linux的转换变得如此轻松。&#8221; 网管u家u.bitscn@com 　　David Witham: 网管联盟bitsCN@com 　　4 sdiff：&#8221;sdiff对2个文本文件之间的差别产生对人类友好的描述。它将文件分列两侧，使用符号来显示只在左边文件中的行，还有2个文件之间有差异的行，还有只在右边文件存在的行。它的结果阅读起来比diff的输出要容易得多。&#8221; 中国网管论坛bbs.bitsCN.com 　　Jim Reem: 网管u家u.bitscn@com 　　5 xargs：&#8221;xargs从标准输出的数据中创建命令行。&#8221; 中国网管论坛bbs.bitsCN.com 　　6 for, while：&#8221;for, while用于&#8217;在一列选项中循环，对每个选项都完成一定的动作。&#8217;&#8221; 网管联盟bitsCN_com 　　7 read：用来&#8221;将标准输入的文本行读入shell变量，以便以后的处理&#8221; 中国网管联盟bitsCN.com 　　8 sort：用来&#8221;将文本按照字母或者数字顺序进行排列;支持多个排列关键字。&#8221; 网管联盟bitsCN@com 　　9 uniq：用来&#8221;删除列表中重复的行&#8221; 网管下载dl.bitscn.com 　　10 tr：用来&#8221;转换或者删除来自文本流的字符&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=155&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">2007-08-01&nbsp;&nbsp;作者:bitsCN整理&nbsp;&nbsp;来源:中国网管联盟
<div class="lharticle">
<div style="clear:both;left:0;float:left;top:0;vertical-align:top;">   </div>
<p>  .Urd463 { display:none; }
<p>　　首先，这是一个确凿的事实，许多IT专 业人士使用Linux命令行，即使在GUI也可用的情况下。嘿，我们的第一个Linux 命令行指南的点击量超过了5万次。但是让我们听一听来自IT专家的理由，在这个案例中，我们倾听来自工程部gotalk高级技术专家David Witham的理由。 </p>
<p class="Urd463">网管网<a href="http://www.bitscn.com">www.bitscn.com</a></p>
<p>　　&#8221;我就靠着命令行为生。命令行给你对你所做的事情和需要完成的事情的最终控制权。如果没有命令来完成的话，你可以编写脚本或者管线来完成。使用 GUI的话，所见即所得。你通常不能再构建你自己的GUI附件了。一个大的好处就是远程访问。使用命令行进行远程访问通常要容易得多，它占用的带宽比终端 服务或者其他的图形化远程访问方式更少。&#8221; <font color="#ffffff">网管下载<a href="http://dl.bitscn.com">dl.bitscn.com</a></font> </p>
<p>　　Joe Klemmer: </p>
<div class="Urd463">网管u家<a href="http://u.bitsCN.com">u.bitsCN.com</a></div>
<p>　　1 expect：&#8221;我使用expect来完成许多通常需要反复执行的需要很多时间的系统管理任务;类似在我的桌面电脑和服务器之间移动文件这样的事情就可以用expect来完成。&#8221; <span class="Urd463">网管网<a href="http://www.bitscn.com">www.bitscn.com</a></span> </p>
<p>　　2 lft：&#8221;lft就像是类固醇的追踪路由。你可以获得比追踪路由更多得多的信息，用于调试连接或者只是用来寻找机器或者系统在哪里。&#8221; <span class="Urd463">网管联盟bitsCN@com</span> </p>
<p>　　3 mc：&#8221;它是最好的文件管理器。自从我在DOS上使用了Norton Commander，从DOS到Linux的转换变得如此轻松。&#8221; <font color="#ffffff">网管u家u.bitscn@com</font> </p>
<p>　　David Witham: <font color="#ffffff">网管联盟bitsCN@com</font> </p>
<p>　　4 sdiff：&#8221;sdiff对2个文本文件之间的差别产生对人类友好的描述。它将文件分列两侧，使用符号来显示只在左边文件中的行，还有2个文件之间有差异的行，还有只在右边文件存在的行。它的结果阅读起来比diff的输出要容易得多。&#8221; </p>
<p class="Urd463">中国网管论坛<a href="http://bbs.bitsCN.com">bbs.bitsCN.com</a></p>
<p>　　Jim Reem: </p>
<p class="Urd463">网管u家u.bitscn@com</p>
<p>　　5 xargs：&#8221;xargs从标准输出的数据中创建命令行。&#8221; <span class="Urd463">中国网管论坛<a href="http://bbs.bitsCN.com">bbs.bitsCN.com</a></span> </p>
<p>　　6 for, while：&#8221;for, while用于&#8217;在一列选项中循环，对每个选项都完成一定的动作。&#8217;&#8221; </p>
<p class="Urd463">网管联盟bitsCN_com</p>
<p>　　7 read：用来&#8221;将标准输入的文本行读入shell变量，以便以后的处理&#8221; </p>
<div class="Urd463">中国网管联盟bitsCN.com</div>
<p>　　8 sort：用来&#8221;将文本按照字母或者数字顺序进行排列;支持多个排列关键字。&#8221; </p>
<p class="Urd463">网管联盟bitsCN@com</p>
<p>　　9 uniq：用来&#8221;删除列表中重复的行&#8221; <span class="Urd463">网管下载<a href="http://dl.bitscn.com">dl.bitscn.com</a></span> </p>
<p>　　10 tr：用来&#8221;转换或者删除来自文本流的字符&#8221; <span class="Urd463">网管bitscn_com</span> </p>
<p>　　11 od：用来&#8221;将二进制文件以十进制(或者十六进制)存储&#8221; </p>
<div class="Urd463">网管网www_bitscn_com</div>
<p>　　12 wc：用来&#8221;统计文件中的字数&#8221; <span class="Urd463">网管论坛bbs_bitsCN_com</span> </p>
<p>　　13 top：&#8221;好像vmstat，获得关于系统运行情况的视图，了解哪个进程占用了全部的内存。&#8221; <span class="Urd463">网管联盟bitsCN_com</span> </p>
<p>　　14 ps：&#8221;了解某个进程的细节&#8221; </p>
<p class="Urd463">中国网管联盟bitsCN.com</p>
<p>　　Christian P. Roberts: <font color="#ffffff">网管论坛bbs_bitsCN_com</font> </p>
<p>　　15 date：&#8221;在制订基准的时候，放在脚本中进行调用，以便输出当前的信息，很有用&#8221; <font color="#ffffff">网管联盟bitsCN@com</font> </p>
<p>　　16 env：&#8221;在解决dotfiles的麻烦的时候，用另外一个账号来查看环境变量。&#8221; <font color="#ffffff">网管下载<a href="http://dl.bitscn.com">dl.bitscn.com</a></font> </p>
<p>　　17 ln：&#8221;啊……软链接是在网站上工作的必需品。&#8221; </p>
<div class="Urd463">网管网<a href="http://www.bitscn.com">www.bitscn.com</a></div>
<p>　　18 mget：&#8221;用得不是非常多了，但是它在用一个命令处理多个文件方面确实不错。&#8221; <font color="#ffffff">网管网www_bitscn_com</font> </p>
<p>　　19 nslookup：计算机的真实名字是什么……或者&#8221;到那里去是否安全?&#8221; <span class="Urd463">网管u家<a href="http://u.bitsCN.com">u.bitsCN.com</a></span> </p>
<p>　　20 passwd：通常让其他人发送这个命令来设置一个我临时使用的密码。 <font color="#ffffff">网管联盟bitsCN@com</font> </p>
<p>　　21 ps：通常用于连接&#8221;kill&#8221;命令 </p>
<div class="Urd463">网管u家<a href="http://u.bitsCN.com">u.bitsCN.com</a></div>
<p>　　22 uname：当在不同的计算机上工作的时候很有帮助，因为这些计算机在操作系统层面可能不同步。 </p>
<div class="Urd463">中国网管论坛<a href="http://bbs.bitsCN.com">bbs.bitsCN.com</a></div>
<p>　　23 whoami：是的，我是谁……意思就是&#8221;我在以什么身份运行?&#8221; <font color="#ffffff">网管</font></p>
</div></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/155/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/155/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=155&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/04/linux%e4%b8%8b%e9%9d%9e%e5%b8%b8%e5%ae%9e%e7%94%a8%e7%9a%84%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%b7%a5%e5%85%b7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux run level explained</title>
		<link>http://klu2008.wordpress.com/2008/09/04/linux-run-level-explained/</link>
		<comments>http://klu2008.wordpress.com/2008/09/04/linux-run-level-explained/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:27:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/04/linux-run-level-explained/</guid>
		<description><![CDATA[Ubuntu不启动X windows 直接进命令行 来源：Linux公社&#160; 作者：Linux整理 Linux默认启动后进入XWindow，但可以修改参数直接进入命令行界面。到底是进入XWindow还是进入命令行界面，是在系统初始化进行的。 对于大部分linux系统，初始化使用init进程， /etc/inittab 为其配置文件。例如 # The default runlevelid:2:initdefault # Boot-time system configuration/initialization script si::sysinit:/etc/init.d/rcS # Runlevelsl0:0:wait:/etc/init.d/rc 0l1:1:wait:/etc/init.d/rc 1l2:2:wait:/etc/init.d/rc 2l3:3:wait:/etc/init.d/rc 3l4:4:wait:/etc/init.d/rc 4l5:5:wait:/etc/init.d/rc 5l6:6:wait:/etc/init.d/rc 6 z6:6:respawn:/sbin/sulogin # How to react to ctrl-alt-delca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now 这些内容的通用格式为 id:runlevels:action:process。id 是惟一标识该项的字符序列。runlevels 定义了操作所使用的运行级别。action 指定了要执行的特定操作。process 定义了要执行的进程。 # 对各个运行级的详细解释： 0 为停机，机器关闭。 1 为单用户模式，就像Win9x下的安全模式类似。 2 为多用户模式，但是没有NFS支持。 3 为完整的多用户模式，是标准的运行级。 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=154&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">
<div align="center">  </div>
<div id="content">
<p>Ubuntu不启动X windows 直接进命令行</p>
<p>来源：<a href="http://www.linuxidc.com/" target="_blank">Linux公社</a>&nbsp; 作者：Linux整理</p>
<p>Linux默认启动后进入XWindow，但可以修改参数直接进入命令行界面。到底是进入XWindow还是进入命令行界面，是在系统初始化进行的。</p>
<p>对于大部分linux系统，初始化使用init进程， /etc/inittab 为其配置文件。例如</p>
<p># The default runlevel<br />id:2:initdefault</p>
<p># Boot-time system configuration/initialization script</p>
<div align="center">  </div>
<p>si::sysinit:/etc/init.d/rcS
<p># Runlevels<br />l0:0:wait:/etc/init.d/rc 0<br />l1:1:wait:/etc/init.d/rc 1<br />l2:2:wait:/etc/init.d/rc 2<br />l3:3:wait:/etc/init.d/rc 3<br />l4:4:wait:/etc/init.d/rc 4<br />l5:5:wait:/etc/init.d/rc 5<br />l6:6:wait:/etc/init.d/rc 6<br /> z6:6:respawn:/sbin/sulogin</p>
<p># How to react to ctrl-alt-del<br />ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now</p>
<p>这些内容的通用格式为 id:runlevels:action:process。id 是惟一标识该项的字符序列。runlevels 定义了操作所使用的运行级别。action 指定了要执行的特定操作。process 定义了要执行的进程。</p>
<p># 对各个运行级的详细解释： <br />0 为停机，机器关闭。 <br />1 为单用户模式，就像Win9x下的安全模式类似。 <br />2 为多用户模式，但是没有NFS支持。 <br />3 为完整的多用户模式，是标准的运行级。 <br />4 一般不用，在一些特殊情况下可以用它来做一些事情。例如在<a href="http://www.linuxidc.com/nbook/index.htm" title="笔记本">笔记本</a>电脑的电池用尽时，可以切换到这个模式来做一些设置。 <br /> 5 就是X11，进到X Window系统了。 <br />6 为重启，运行init 6机器就会重启。</p>
<p>XWindow是init5，字符是init3。将id设置为runlevel设置为3，就可以直接在系统初始化的时候直接进入文本界面。</p>
<p>但<a href="http://www.linuxidc.com/topicnews.aspx?tid=2" title="Ubuntu">Ubuntu</a>并 没有采用init的方法，并没有 /etc/inittab这个文件。init使用的是串行的方式，引导很耗时。RedHat9启动时串行执行大量的脚本以启动各种需要的服务（启动时可以 看到）。Ubuntu采用了upstart，是一个基于事件的 init 的替代程序，用于 Ubuntu 发行版。</p>
<p><a href="http://www.linuxidc.com/topicnews.aspx?tid=2" title="Ubuntu">Ubuntu</a>中没有 /etc/inittab这个文件，但用户可以自己添加。当系统中有 /etc/inittab 时Ubuntu会按照配置来启动。</p>
<p>所以要想直接进命令行，第一种方法是用户添加 /etc/inittab，不过Debian或是<a href="http://www.linuxidc.com/topicnews.aspx?tid=2" title="Ubuntu">Ubuntu</a>中默认run level是2，且2~5都是指X环境。（但命令行是几？不确定，尚未测试）</p>
<p>另外一种方法，可以考虑在对应的runlevel级别停止gdm服务：</p>
<p>$ sudo mv /etc/rc2.d/S30gdm /etc/rc2.d/K30gdm （有可能是S13gdm，不一定）</p>
<p>还可以把gdm删掉。先备份/etc/init.d/gdm到其它位置:</p>
<p>$ sudo /etc/init.d/gdm /usr/gdm</p>
<p>然后删除/etc/init.d/gdm,删除后只是不启动XWindow,其它服务不变。需要直接进入XWindow到话，再复制回来。</p>
<p>其实如果仅仅是为了在命令行下的话，在xwindows界面下按Ctrl + Alt + F2 进入字符界面，按Ctrl + Alt + F7 回到图形界面。</p>
<p>还有一种方法：</p>
<p>$sudo apt-get rcconf</p>
<p>$sudo rcconf</p>
<p>在启动中将gdm去掉。 </p>
</div></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/154/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/154/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=154&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/04/linux-run-level-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu用户名或密码忘了的解决方案</title>
		<link>http://klu2008.wordpress.com/2008/09/03/ubuntu%e7%94%a8%e6%88%b7%e5%90%8d%e6%88%96%e5%af%86%e7%a0%81%e5%bf%98%e4%ba%86%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88/</link>
		<comments>http://klu2008.wordpress.com/2008/09/03/ubuntu%e7%94%a8%e6%88%b7%e5%90%8d%e6%88%96%e5%af%86%e7%a0%81%e5%bf%98%e4%ba%86%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:53:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/03/ubuntu%e7%94%a8%e6%88%b7%e5%90%8d%e6%88%96%e5%af%86%e7%a0%81%e5%bf%98%e4%ba%86%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88/</guid>
		<description><![CDATA[[日期：2008-09-02] &#160;&#160;&#160; 来源：Linux社区&#160; 作者：Frthred &#160;&#160;&#160; 如果忘记了Ubuntu的用户名或是密码请按以下操作： 1，在启动的时候，上下移动，选中（不是按回车）类似这样的修复模式&#34;Ubuntu-x.x.xx.xx-generic (recovery mode)，然后按e。 2，在第二层菜单选择有kernel这行，如：&#34;kernel /boot/vmlinux-x.x.xx-xx-generic root=UUID=ae424e-bod0-475c-2342433 ro single&#34; 按下e进行编辑。 3，修改启动参数,将后面的ro single改为rw single init=/bin/bash，然后按回车。 如：&#34;kernel /boot/vmlinux-x.x.xx-xx-generic root=UUID=ae424e-bod0-475c-2342433 rw single init=/bin/bash&#34; 4，按b启动系统就可以进入single模式而不需要密码了。 5，然后用passwd修改密码：具体命令是passwd 用户名。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=153&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">[日期：2008-09-02] &nbsp;&nbsp;&nbsp; 来源：Linux社区&nbsp; 作者：Frthred &nbsp;&nbsp;&nbsp; </p>
<p>如果忘记了Ubuntu的用户名或是密码请按以下操作：</p>
<p>1，在启动的时候，上下移动，选中（不是按回车）类似这样的修复模式&quot;Ubuntu-x.x.xx.xx-generic (recovery mode)，然后按e。</p>
<p>2，在第二层菜单选择有kernel这行，如：&quot;kernel /boot/vmlinux-x.x.xx-xx-generic root=UUID=ae424e-bod0-475c-2342433 ro single&quot; 按下e进行编辑。</p>
<p>3，修改启动参数,将后面的ro single改为rw single init=/bin/bash，然后按回车。</p>
<p>如：&quot;kernel /boot/vmlinux-x.x.xx-xx-generic root=UUID=ae424e-bod0-475c-2342433 rw single init=/bin/bash&quot;</p>
<p>4，按b启动系统就可以进入single模式而不需要密码了。</p>
<p> 5，然后用passwd修改密码：具体命令是passwd 用户名。 </div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/153/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/153/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=153&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/03/ubuntu%e7%94%a8%e6%88%b7%e5%90%8d%e6%88%96%e5%af%86%e7%a0%81%e5%bf%98%e4%ba%86%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
		<item>
		<title>bash的几个初始化文件</title>
		<link>http://klu2008.wordpress.com/2008/09/03/bash%e7%9a%84%e5%87%a0%e4%b8%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e6%96%87%e4%bb%b6/</link>
		<comments>http://klu2008.wordpress.com/2008/09/03/bash%e7%9a%84%e5%87%a0%e4%b8%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e6%96%87%e4%bb%b6/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:50:00 +0000</pubDate>
		<dc:creator>fei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://klu2008.wordpress.com/2008/09/03/bash%e7%9a%84%e5%87%a0%e4%b8%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e6%96%87%e4%bb%b6/</guid>
		<description><![CDATA[[日期：2008-09-01] &#160;&#160;&#160; 来源：Linux社区&#160; 作者：Jeicoe &#160;&#160;&#160; （1）/etc/profile 全局（公有）配置，不管是哪个用户，登录时都会读取该文件。 （2）/ect/bashrc Ubuntu没有此文件，与之对应的是/ect/bash.bashrc 它也是全局（公有）的 bash执行时，不管是何种方式，都会读取此文件。 （3）~/.profile 若bash是以login方式执行时，读取~/.bash_profile，若它不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。 另外，图形模式登录时，此文件将被读取，即使存在~/.bash_profile和~/.bash_login。 （4）~/.bash_login 若bash是以login方式执行时，读取~/.bash_profile，若它不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。 （5）~/.bash_profile Unbutu默认没有此文件，可新建。 只有bash是以login形式执行时，才会读取此文件。通常该配置文件还会配置成去读取~/.bashrc。 （6）~/.bashrc 当bash是以non-login形式执行时，读取此文件。若是以login形式执行，则不会读取此文件。 （7）~/.bash_logout 注销时，且是longin形式，此文件才会读取。也就是说，在文本模式注销时，此文件会被读取，图形模式注销时，此文件不会被读取。 下面是在本机的几个例子： 1. 图形模式登录时，顺序读取：/etc/profile和~/.profile 2. 图形模式登录后，打开终端时，顺序读取：/etc/bash.bashrc和~/.bashrc 3. 文本模式登录时，顺序读取：/etc/bash.bashrc，/etc/profile和~/.bash_profile 4. 从其它用户su到该用户，则分两种情况： （1）如果带-l参数（或-参数，&#8211;login参数），如：su -l username，则bash是lonin的，它将顺序读取以下配置文件：/etc/bash.bashrc，/etc/profile和~/.bash_profile。 （2）如果没有带-l参数，则bash是non-login的，它将顺序读取：/etc/bash.bashrc和~/.bashrc 5. 注销时，或退出su登录的用户，如果是longin方式，那么bash会读取：~/.bash_logout 6. 执行自定义的shell文件时，若使用&#8221;bash -l a.sh&#8221;的方式，则bash会读取行：/etc/profile和~/.bash_profile，若使用其它方式，如：bash a.sh， ./a.sh，sh a.sh（这个不属于bash shell），则不会读取上面的任何文件。 7. 上面的例子凡是读取到~/.bash_profile的，若该文件不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=152&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div dir="ltr">[日期：2008-09-01] &nbsp;&nbsp;&nbsp; 来源：Linux社区&nbsp; 作者：Jeicoe &nbsp;&nbsp;&nbsp; </p>
<p>（1）/etc/profile</p>
<p>全局（公有）配置，不管是哪个用户，登录时都会读取该文件。</p>
<p>（2）/ect/bashrc</p>
<p>Ubuntu没有此文件，与之对应的是/ect/bash.bashrc</p>
<p>它也是全局（公有）的</p>
<p>bash执行时，不管是何种方式，都会读取此文件。</p>
<p>（3）~/.profile</p>
<p>若bash是以login方式执行时，读取~/.bash_profile，若它不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。</p>
<p>另外，图形模式登录时，此文件将被读取，即使存在~/.bash_profile和~/.bash_login。</p>
<p>（4）~/.bash_login</p>
<p>若bash是以login方式执行时，读取~/.bash_profile，若它不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。</p>
<p>（5）~/.bash_profile</p>
<p>Unbutu默认没有此文件，可新建。</p>
<p>只有bash是以login形式执行时，才会读取此文件。通常该配置文件还会配置成去读取~/.bashrc。</p>
<p>（6）~/.bashrc</p>
<p>当bash是以non-login形式执行时，读取此文件。若是以login形式执行，则不会读取此文件。</p>
<p>（7）~/.bash_logout</p>
<p>注销时，且是longin形式，此文件才会读取。也就是说，在文本模式注销时，此文件会被读取，图形模式注销时，此文件不会被读取。</p>
<p>下面是在本机的几个例子：</p>
<p>1. 图形模式登录时，顺序读取：/etc/profile和~/.profile</p>
<p>2. 图形模式登录后，打开终端时，顺序读取：/etc/bash.bashrc和~/.bashrc</p>
<p>3. 文本模式登录时，顺序读取：/etc/bash.bashrc，/etc/profile和~/.bash_profile</p>
<p>4. 从其它用户su到该用户，则分两种情况：</p>
<p>（1）如果带-l参数（或-参数，&#8211;login参数），如：su -l username，则bash是lonin的，它将顺序读取以下配置文件：/etc/bash.bashrc，/etc/profile和~/.bash_profile。</p>
<p>（2）如果没有带-l参数，则bash是non-login的，它将顺序读取：/etc/bash.bashrc和~/.bashrc</p>
<p>5. 注销时，或退出su登录的用户，如果是longin方式，那么bash会读取：~/.bash_logout</p>
<p>6. 执行自定义的shell文件时，若使用&#8221;bash -l a.sh&#8221;的方式，则bash会读取行：/etc/profile和~/.bash_profile，若使用其它方式，如：bash a.sh， ./a.sh，sh a.sh（这个不属于bash shell），则不会读取上面的任何文件。</p>
<p>7. 上面的例子凡是读取到~/.bash_profile的，若该文件不存在，则读取~/.bash_login，若前两者不存在，读取~/.profile。</p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/klu2008.wordpress.com/152/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/klu2008.wordpress.com/152/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/klu2008.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/klu2008.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/klu2008.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=klu2008.wordpress.com&amp;blog=3380170&amp;post=152&amp;subd=klu2008&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://klu2008.wordpress.com/2008/09/03/bash%e7%9a%84%e5%87%a0%e4%b8%aa%e5%88%9d%e5%a7%8b%e5%8c%96%e6%96%87%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef1d7b331f91fe856ecfe01748c60449?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">fei</media:title>
		</media:content>
	</item>
	</channel>
</rss>
