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

<channel>
	<title>天道酬勤 &#187; shell</title>
	<atom:link href="http://www.ochef.net/tag/shell/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ochef.net</link>
	<description>Oracle and My Life</description>
	<lastBuildDate>Mon, 09 Jan 2012 05:39:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unix、Linux下shell配置文件之间的区别</title>
		<link>http://www.ochef.net/2009/09/compare-unix-shell.html</link>
		<comments>http://www.ochef.net/2009/09/compare-unix-shell.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 01:08:59 +0000</pubDate>
		<dc:creator>ochef</dc:creator>
				<category><![CDATA[(l)unix-script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.ochef.net/?p=604</guid>
		<description><![CDATA[随着在Unix和Linux平台下工作的时间越长，不同种类的shell繁多，感觉对shell的认识由清晰开始变得模糊，所以应该赶紧弄清楚它们，shell太重要了。以下内容来自互联网综合、整理后的。 .profile：是Bourne Shell (sh)的配置文件，Korn Shell (ksh)兼容sh所以也会使用.profile。 /etc/profile：此文件为系统的每个用户设置环境信息,当用户第一次登录时该文件被执行，并从/etc/profile.d目录的配置文件中搜集shell的设置。 .bash_ profile：是bash特有的, 由于bash被设计成兼容sh、ksh并有csh的特征, 所以会在用户主目录依次查找.bash_profile， .bash_login，.profile并用找到的第一个作为自己的配置文件。 ~/.bash_profile：每个用户都可使用该文件输入专用于自己使用的shell信息。当用户登录时，该文件仅仅执行一次。默认情况下，它设置一些环境变量，执行用户的.bashrc文件。 .login 是C Shell (csh) 的配置文件。 在Linux下sh是bash的一个链接, 如果bash使用sh命令启动的, 就会以sh兼容方式运行使用.profile，可用man bash命令查看更详细的解释。 /etc/bashrc：为每一个运行bash shell的用户执行此文件，当bash shell被打开时，该文件被读取。 ~/.bashrc：该文件包含专用于你的bash shell的bash信息，当登录时以及每次打开新的shell时，该该文件被读取。 ~/.bash_logout：当每次退出系统(退出bash shell)时，执行该文件。另外，/etc/profile中设定的变量(全局)的可以作用于任何用户，而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量，它们是&#8221;父子&#8221;关系。 ~/.bash_profile：是交互式、login 方式进入 bash 运行的；~/.bashrc 是交互式 non-login 方式进入 bash 运行的。通常二者设置大致相同，所以通常前者会调用后者。 -The End-<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-ids-11-5-uc5-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install IDS 11.5 UC5 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-db2-9-1-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install DB2 9.1 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-sybase-ase-15-0-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install Sybase ASE 15.0 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F05%2Fthe-difference-between-solaris-and-opensolaris.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Solaris与OpenSolaris的区别</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>随着在Unix和Linux平台下工作的时间越长，不同种类的shell繁多，感觉对shell的认识由清晰开始变得模糊，所以应该赶紧弄清楚它们，shell太重要了。以下内容来自互联网综合、整理后的。</p>
<p><span style="color: #ff0000;">.profile：</span>是Bourne Shell (sh)的配置文件，Korn Shell (ksh)兼容sh所以也会使用.profile。</p>
<p><span style="color: #ff0000;">/etc/profile：</span>此文件为系统的每个用户设置环境信息,当用户第一次登录时该文件被执行，并从/etc/profile.d目录的配置文件中搜集shell的设置。</p>
<p><span style="color: #ff0000;">.bash_ profile：</span>是bash特有的, 由于bash被设计成兼容sh、ksh并有csh的特征, 所以会在用户主目录依次查找.bash_profile， .bash_login，.profile并用找到的第一个作为自己的配置文件。</p>
<p><span style="color: #ff0000;">~/.bash_profile：</span>每个用户都可使用该文件输入专用于自己使用的shell信息。当用户登录时，该文件仅仅执行一次。默认情况下，它设置一些环境变量，执行用户的.bashrc文件。</p>
<p><span style="color: #ff0000;">.login </span>是C Shell (csh) 的配置文件。</p>
<p>在Linux下sh是bash的一个链接, 如果bash使用sh命令启动的, 就会以sh兼容方式运行使用.profile，可用man bash命令查看更详细的解释。</p>
<p><span style="color: #ff0000;">/etc/bashrc：</span>为每一个运行bash shell的用户执行此文件，当bash shell被打开时，该文件被读取。</p>
<p><span style="color: #ff0000;">~/.bashrc：</span>该文件包含专用于你的bash shell的bash信息，当登录时以及每次打开新的shell时，该该文件被读取。</p>
<p><span style="color: #ff0000;">~/.bash_logout：</span>当每次退出系统(退出bash shell)时，执行该文件。另外，/etc/profile中设定的变量(全局)的可以作用于任何用户，而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量，它们是&#8221;父子&#8221;关系。</p>
<p>~/.bash_profile：是交互式、login 方式进入 bash 运行的；~/.bashrc 是交互式 non-login 方式进入 bash 运行的。通常二者设置大致相同，所以通常前者会调用后者。</p>
<p>-The End-</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-ids-11-5-uc5-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install IDS 11.5 UC5 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-db2-9-1-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install DB2 9.1 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Finstall-sybase-ase-15-0-for-linux.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Install Sybase ASE 15.0 for Linux</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.ochef.net%2F2009%2F05%2Fthe-difference-between-solaris-and-opensolaris.html&from=http%3A%2F%2Fwww.ochef.net%2F2009%2F09%2Fcompare-unix-shell.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Solaris与OpenSolaris的区别</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.ochef.net/2009/09/compare-unix-shell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

