<?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>Linux and Virtualization &#187; Bash</title>
	<atom:link href="http://fclose.com/b/linux/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://fclose.com/b/linux</link>
	<description>Clear solutions, tutorials and tips on Linux and virtualization from the author&#039;s experience with clusters.</description>
	<lastBuildDate>Sat, 04 Feb 2012 04:40:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing ns-2 and ns-3 on Fedora Linux</title>
		<link>http://fclose.com/b/linux/3376/install-ns-2-and-ns-3-on-fedora-linux/</link>
		<comments>http://fclose.com/b/linux/3376/install-ns-2-and-ns-3-on-fedora-linux/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 07:53:22 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[nam]]></category>
		<category><![CDATA[ns-2]]></category>
		<category><![CDATA[ns-3]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://fclose.com/b/linux/?p=3376</guid>
		<description><![CDATA[ns is a discrete-event network simulator targeted primarily for research and educational use. There are two version of ns, ns-2 and ns-3, which are quite different with each other in the implementation and method to use them. In this post, we introduce how to install ns-2 and ns-3 on Fedora Linux 15. Install ns-2.34 on [...]]]></description>
			<content:encoded><![CDATA[<p>ns is a discrete-event network simulator targeted primarily for research and educational use. There are two version of ns, <a href="http://fclose.com/t/go/ns-2/" rel="nofollow">ns-2</a> and <a href="http://fclose.com/t/go/ns-3/" rel="nofollow">ns-3</a>, which are quite different with each other in the implementation and method to use them. In this post, we introduce how to install ns-2 and ns-3 on Fedora Linux 15.</p>
<h3>Install ns-2.34 on Fedora</h3>
<p>Download the allinone package</p>
<pre>$ wget http://downloads.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz</pre>
<p>Uncompress the pacakge</p>
<pre>$ tar xf ns-allinone-2.34.tar.gz</pre>
<p>Install needed pacakges</p>
<pre># yum install gcc make libX11-devel libXt-devel libXmu-devel</pre>
<p>Ns-2 requires older version of gcc. So we install gcc-34 and gcc-34-c++ for it</p>
<pre># yum install compat-gcc-34 compat-gcc-34-c++</pre>
<p>Install the allinon package of ns-2. During the install process, specify the CXX compiler we use</p>
<pre>$ cd ns-allinone-2.34
$ CXX=g++34 ./install</pre>
<p>Configure the environmental variables for ns-2 and nam, and add the executables to the PATH so that we can use ns and nam directly.</p>
<p>Add to <em>~/.bashrc</em> if you use bash</p>
<pre>NS_HOME=/full/path/to/ns-allinone-2.34
PATH=$NS_HOME/bin:$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix:$PATH
export PATH</pre>
<p>or</p>
<p>Add to <em>~/.cshrc_user</em> if you use c shell</p>
<pre>setenv NS_HOME "/full/path/to/ns-allinone-2.34"
setenv PATH "${PATH}:${NS_HOME}/bin:${NS_HOME}/tcl8.4.18/unix:${NS_HOME}/tk8.4.18/unix"
setenv LD_LIBRARY_PATH "${NS_HOME}/otcl-1.13:${NS_HOME}/ns-2.34/lib:/usr/local/lib"
setenv TCL_LIBRARY "${NS_HOME}/tcl8.4.18/library"</pre>
<p>The installation is done by this step. Open another shell and try our installation:</p>
<pre>$ nam</pre>
<p>and</p>
<pre>$ ns</pre>
<h3>Install ns-3.12.1 on Fedora</h3>
<p>Install needed packages</p>
<pre># yum install libxml2 libxml2-devel gcc gcc-c++ make automake \
autoconf binutils openssh-server openssh-clients openssl python \
python-devel mercurial bzr scons flex bison tcpdump valgrind gdb</pre>
<p>Download the allinone pacakge for ns-3</p>
<pre>$ mkdir tarballs
$ cd tarballs
$ wget http://www.nsnam.org/release/ns-allinone-3.12.1.tar.bz2
$ tar xjf ns-allinone-3.12.1.tar.bz2</pre>
<p>Build ns-3</p>
<pre>$ cd ns-allinone-3.12.1/
$ ./build.py</pre>
<p>We will now interact directly with Waf in the ns-3.12.1 directory</p>
<pre>$ cd ns-3.12.1</pre>
<p>Configuration with Waf</p>
<pre>$ ./waf -d optimized configure --enable-examples; ./waf</pre>
<p>Validate our installation by running one example</p>
<pre>$ ./waf shell
$ cd build/optimized/examples/
$ udp/udp-echo</pre>
<p>Use tcpdump to display the simulation result</p>
<pre>$ tcpdump -tt -r udp-echo-0-1.pcap</pre>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/3376/install-ns-2-and-ns-3-on-fedora-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Find out Linux and Windows Uptime</title>
		<link>http://fclose.com/b/linux/2849/how-to-find-out-linux-and-windows-uptime/</link>
		<comments>http://fclose.com/b/linux/2849/how-to-find-out-linux-and-windows-uptime/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 14:33:07 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://fclose.com/b/?p=2849</guid>
		<description><![CDATA[How to find out Linux and Windows uptime is introduced in this post. Linux uptime Linux uptime can be easily found out by the uptime command: $ uptime 22:19:29 up 10 days, 22:26,  5 users,  load average: 0.00, 0.00, 0.00 The system is up for 10 days, 22 hours and 26 minutes. uptime gives a [...]]]></description>
			<content:encoded><![CDATA[<p>How to find out Linux and Windows uptime is introduced in this post.</p>
<h3>Linux uptime</h3>
<p>Linux uptime can be easily found out by the <a href="http://fclose.com/p/linux/man/1-uptime/">uptime</a> command:</p>
<pre>$ uptime
22:19:29 up 10 days, 22:26,  5 users,  load average: 0.00, 0.00, 0.00
</pre>
<p>The system is up for 10 days, 22 hours and 26 minutes.</p>
<p>uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.</p>
<p>The current date and time can be found out by <a href="http://fclose.com/p/linux/man/1-date/">date</a> command:</p>
<pre>$ date
Thu Dec  9 22:30:18 HKT 2010</pre>
<h3>Windows uptime</h3>
<p>1. Go to &#8220;Start&#8221; -&gt; &#8220;Run&#8221;.<br />
2. Write &#8220;cmd&#8221; and press &#8220;Enter&#8221;.<br />
3. Write the following command in the command line:</p>
<pre>net statistics server
</pre>
<p>Or for short</p>
<pre>net stats srv
</pre>
<p>A sample output is:</p>
<pre>I:&gt;net statistics server
Server Statistics for \W2KPGTS

Statistics since 12/2/2010 9:06 AM

Sessions accepted                  2
Sessions timed-out                 0
Sessions errored-out               0

Kilobytes sent                     9724
Kilobytes received                 2716

Mean response time (msec)          0

System errors                      0
Permission violations              0
Password violations                12

Files accessed                     947
Communication devices accessed     0
Print jobs spooled                 0

Times buffers exhausted

Big buffers                      0
Request buffers                  0

The command completed successfully.
</pre>
<p>The line that start with &#8220;Statistics since …&#8221; provides the time that the server was up from.</p>
<p>Then the current data and time can be found out by date and time command:</p>
<pre>I:&gt;date
The current date is: Thu 12/09/2010
Enter the new date: (mm-dd-yy)

I:&gt;time
The current time is: 22:25:13.37
Enter the new time:
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2849/how-to-find-out-linux-and-windows-uptime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding out Linux Network Configuration Information</title>
		<link>http://fclose.com/b/linux/2350/finding-out-linux-network-configuration-information/</link>
		<comments>http://fclose.com/b/linux/2350/finding-out-linux-network-configuration-information/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 15:01:09 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2350</guid>
		<description><![CDATA[There is various network configuration information in Linux and lots tools can be used to find out those configuration information. Finding out these network information in Fedora Linux as the example will be introduced. IP address, MAC address and netmask ifconfig will print out all the network interfaces and their information including the IP address [...]]]></description>
			<content:encoded><![CDATA[<p>There is various network configuration information in Linux and lots tools can be used to find out those configuration information. Finding out these network information in Fedora Linux as the example will be introduced.</p>
<h3>IP address, MAC address and netmask</h3>
<p><em>ifconfig</em> will print out all the network interfaces and their information including the IP address and netmask.</p>
<pre>$ ifconfig</pre>
<p>A typical output is like this:</p>
<pre>eth0      Link encap:Ethernet  HWaddr 00:26:22:A1:25:0F
inet addr:143.89.135.175  Bcast:143.89.135.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:305973 errors:0 dropped:0 overruns:0 frame:0
TX packets:337971 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:196287324 (187.1 MiB)  TX bytes:134890044 (128.6 MiB)
Interrupt:30

lo        Link encap:Local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING  MTU:16436  Metric:1
RX packets:274 errors:0 dropped:0 overruns:0 frame:0
TX packets:274 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:37244 (36.3 KiB)  TX bytes:37244 (36.3 KiB)</pre>
<p><em>eth0 </em>is the network interface. <em>lo</em> is the loopback device.</p>
<p>The IP address is shown in <em>inet addr</em> field.</p>
<h3>DNS server, hosts file and DNS look up order</h3>
<p>The DNS server for Linux to contact is stored in <em>/etc/resolve.conf</em>. The DNS server(s) can be listed by:</p>
<pre>$ cat /etc/resolve.conf</pre>
<p>A line like this specifies the DNS server:</p>
<pre>nameserver 8.8.8.8</pre>
<p>The <em>hosts</em> file for Linux is stored in <em>/etc/hosts. </em>The first two lines (127.0.0.1 and ::1) which map the <em>localhost</em> name shouldn&#8217;t be changed since <em>localhost</em> is used for interprocess communication.</p>
<pre>127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.1.8   mysite.mydomain mysite</pre>
<p>The order of DNS look up is defined in <em>/etc/nsswitch.conf</em>. Whether the hosts file should be looked up first can be defined. The line in <em>/etc/nsswitch.conf</em> for DNS look up order is:</p>
<pre>hosts:      files mdns4_minimal [NOTFOUND=return] dns</pre>
<h3>Gateway</h3>
<p>The gateway can be find out by looking at the rules in route table:</p>
<pre>$ ip route show</pre>
<p>A line like this defines the gateway:</p>
<pre>default via 143.89.135.254 dev eth0  proto static</pre>
<h3>Host name</h3>
<p>The host name is specified in <em>/etc/sysconfig/network.</em> The HOSTNAME variable is for the machine&#8217;s host name:</p>
<pre>HOSTNAME=localhost.localdomain</pre>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2350/finding-out-linux-network-configuration-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Email from mailx Command in Linux Using Gmail’s SMTP</title>
		<link>http://fclose.com/b/linux/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/</link>
		<comments>http://fclose.com/b/linux/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:24:46 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/?p=1411</guid>
		<description><![CDATA[mailx or mail command in Linux is still providing service for guys like me, especially when we need to send email automatically by script. gmail is great. Now, how to use gmail&#8217;s smtp in mailx/mail? gmail is a little special since gmail&#8217;s smtp server requires tls authorization. The good news is that mailx supports it. [...]]]></description>
			<content:encoded><![CDATA[<p>mailx or mail command in Linux is still providing service for guys like me, especially when we need to send email automatically by script. gmail is great. Now, how to use gmail&#8217;s smtp in mailx/mail? gmail is a little special since gmail&#8217;s smtp server requires tls authorization. The good news is that mailx supports it. Let&#8217;s look at how to use it.</p>
<p>First, find out Fixforx&#8217;s profile directory in the home directory (I believe most of the users on Linux use Firefox. If you are not using Firefox, what you need to do is try it ;) . It has a format like this:</p>
<pre>~/.mozilla/firefox/xxxxxxxx.default</pre>
<p>xxxxxxxx is a random string that&#8217;s different for different users. You can easily find it out by looking into the directory <em>~/.mozilla/firefox</em>.</p>
<p>There are two ways to do this: using all-in-one command or putting configurations into profile. The all-in-one-command way needs no other configurations except the command line itself, while the way using configuration has a clearer command.</p>
<h3>All-in-one command</h3>
<p>This is an all-in-one command that sends email to $TO_EMAIL_ADDRESS</p>
<pre>mailx -v -s "$EMAIL_SUBJECT"
-S smtp-use-starttls
-S ssl-verify=ignore
-S smtp-auth=login
-S smtp=smtp://smtp.gmail.com:587
-S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)"
-S smtp-auth-user=$FROM_EMAIL_ADDRESS
-S smtp-auth-password=$EMAIL_ACCOUNT_PASSWORD
-S ssl-verify=ignore
-S nss-config-dir=~/.mozilla/firefox/xxxxxxxx.default/
$TO_EMAIL_ADDRESS</pre>
<p>Replace the $XXX with the value that is actually used. The meaning is obvious. And remember to change xxxxxxxx to the string that&#8217;s part of the Firefox profile directory.</p>
<p>This command will ask for the email content. Type in the mail content and after finishing the email, use &#8220;Ctrl+d&#8221; to tell mailx you have finished. Then this mail will be sent out through gmail&#8217;s smtp server. You can also use pipe like this:</p>
<pre>echo "The mail content" | mail -v -s ...</pre>
<h3>Use configuration file</h3>
<p>There are too many options in the above command? Yes&#8230; I must confess so. We can write most of them into mailx/mail&#8217;s configuration file <em>~/.mailrc</em></p>
<pre>set smtp-use-starttls
set nss-config-dir=~/.mozilla/firefox/xxxxxxxx.default/
set ssl-verify=ignore
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=$FROM_EMAIL_ADDRESS
set smtp-auth-password=$EMAIL_ACCOUNT_PASSWORD
set from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)"</pre>
<p>Change the $XXX and xxxxxxx to the right value for you. When sending mails, use this command:</p>
<pre>mailx -v -s "$EMAIL_SUBJECT" $TO_EMAIL_ADDRESS</pre>
<p>Then, time to enjoy it!</p>
<p><span style="font-size: x-small;"><strong>Update history </strong>Mar. 11 2010 Apr. 29 2010. Add title. Jul. 12, 2010. Revise the article. Jul. 26, 2010. Add highlight colour to pre tags.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A Good Bash Tutorial: Advanced Bash-Scripting Guide</title>
		<link>http://fclose.com/b/linux/434/a-good-bash-tutorial-advanced-bash-scripting-guide/</link>
		<comments>http://fclose.com/b/linux/434/a-good-bash-tutorial-advanced-bash-scripting-guide/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 10:43:26 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/a-good-bash-tutorial-advanced-bash-scripting-guide/</guid>
		<description><![CDATA[Advanced Bash-Scripting Guide &#8211; An in-depth exploration of the art of shell scripting by Mendel Cooper Link here: http://www.tldp.org/LDP/abs/html/index.html]]></description>
			<content:encoded><![CDATA[<p>Advanced Bash-Scripting Guide &#8211; An in-depth exploration of the art of shell scripting<br />
by Mendel Cooper</p>
<p>Link here: <a href="http://www.tldp.org/LDP/abs/html/index.html">http://www.tldp.org/LDP/abs/html/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/434/a-good-bash-tutorial-advanced-bash-scripting-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My .bashrc .alias .lftp .fonts.conf</title>
		<link>http://fclose.com/b/linux/139/my-bashrc-alias-lftp-fonts-conf/</link>
		<comments>http://fclose.com/b/linux/139/my-bashrc-alias-lftp-fonts-conf/#comments</comments>
		<pubDate>Wed, 13 May 2009 06:17:00 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[lftp]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/%e6%88%91%e7%9a%84bashrc-alias-lftp-fontsconf%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6/</guid>
		<description><![CDATA[~/.bashrc # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions . ~/.alias # export GTK_IM_MODULE=ibus ################################## ~/.alias alias rm=&#8217;rm -i&#8217; alias l=&#8217;ll -h&#8217; ################################## ~/.lftprc set ftp:charset GBK set file:charset UTF-8 #set net:connection-limit 30 set net:reconnect-interval-base 12 set net:reconnect-interval-multiplier 1 ################################## .fonts.conf Fedora-中文字体设置]]></description>
			<content:encoded><![CDATA[<p>~/.bashrc</p>
<p># .bashrc</p>
<p># Source global definitions<br />
if [ -f /etc/bashrc ]; then<br />
. /etc/bashrc<br />
fi</p>
<p># User specific aliases and functions<br />
. ~/.alias</p>
<p># export GTK_IM_MODULE=ibus</p>
<p>##################################<br />
~/.alias<br />
alias rm=&#8217;rm -i&#8217;<br />
alias l=&#8217;ll -h&#8217;</p>
<p>##################################<br />
~/.lftprc</p>
<p>set ftp:charset GBK<br />
set file:charset UTF-8<br />
#set net:connection-limit 30<br />
set net:reconnect-interval-base 12<br />
set net:reconnect-interval-multiplier 1</p>
<p>##################################<br />
.fonts.conf</p>
<p><a href="/Fedora-中文字体设置/">Fedora-中文字体设置</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/139/my-bashrc-alias-lftp-fonts-conf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell 中 ls 颜色设定</title>
		<link>http://fclose.com/b/linux/129/shell-%e4%b8%ad-ls-%e9%a2%9c%e8%89%b2%e8%ae%be%e5%ae%9a/</link>
		<comments>http://fclose.com/b/linux/129/shell-%e4%b8%ad-ls-%e9%a2%9c%e8%89%b2%e8%ae%be%e5%ae%9a/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:04:00 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/shell-%e4%b8%ad-ls-%e9%a2%9c%e8%89%b2%e8%ae%be%e5%ae%9a/</guid>
		<description><![CDATA[bash中，ls后的颜色在黑色背景下有些不是很清楚，例如文件夹是蓝色的，在黑色背景下不好认。设置一下自己的~/.dir_colors可以解决： 复制一份系统的到自己的目录：cp /etc/DIR_COLORS ~/.dir_colors 修改 .dir_colors 示例&#8230;# Below are the color init strings for the basic file types. A color init# string consists of one or more of the following numeric codes:# Attribute codes:# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed# Text color codes:# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white# Background color codes:# 40=black [...]]]></description>
			<content:encoded><![CDATA[<p>bash中，ls后的颜色在黑色背景下有些不是很清楚，例如文件夹是蓝色的，在黑色背景下不好认。<br />设置一下自己的~/.dir_colors可以解决：</p>
<p>复制一份系统的到自己的目录：<br />cp /etc/DIR_COLORS ~/.dir_colors</p>
<p>修改 .dir_colors</p>
<p>示例<br />&#8230;<br /># Below are the color init strings for the basic file types. A color init<br /># string consists of one or more of the following numeric codes:<br /># Attribute codes:<br /># 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed<br /># Text color codes:<br /># 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white<br /># Background color codes:<br /># 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white<br />NORMAL 00 # global default, although everything should be something.<br />FILE 00   # normal file<br />DIR 01;34;47  # directory<br />&#8230;</p>
<p>DIR 01;34;47  # directory<br />表示文件夹字体为粗体白底蓝色。这样看起来好多了。</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/129/shell-%e4%b8%ad-ls-%e9%a2%9c%e8%89%b2%e8%ae%be%e5%ae%9a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

