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

<channel>
	<title>自由自在 &#187; Linux</title>
	<atom:link href="http://www.aease.org/category/lamp/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aease.org</link>
	<description>懦怯囚禁人的灵魂, 希望可以感受自由!</description>
	<lastBuildDate>Thu, 29 Jul 2010 08:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Linux技巧17. Grep命令</title>
		<link>http://www.aease.org/2009/08/linux-hacks17-grep-command.html</link>
		<comments>http://www.aease.org/2009/08/linux-hacks17-grep-command.html#comments</comments>
		<pubDate>Sat, 01 Aug 2009 15:51:26 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=592</guid>
		<description><![CDATA[Grep命令用于在文件中搜索特定的文本. 是一个具有许多选项的非常强大的命令. 语法: grep [options] pattern [files] 我如何才能找到文件中匹配指定关键字的所有行? 在这个例子中, grep在/etc/passwd文件中查找包含文件John并显示所有的匹配行. # grep John /etc/passwd jsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bash jdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash 选项 -v, 显示除匹配行外的所有行. 在下面的例子中, 显示/etc/passwd文件中未匹配John的所有记录行. 注释: 在/etc/passwd中有一些行是未包含单词John. 下面仅显示输出的第一行. # grep -v John /etc/passwd jbourne:x:1084:1084:Jason Bourne:/home/jbourne:/bin/bash 计算特定文件中文件模式的匹配行数 在下面的例子中, 显示/etc/passwd文件里包含John文本的总行数. # grep -c John /etc/passwd 2 你也可以通过-cv选项统计未匹配指定模式的总行数. # grep -cv John /etc/passwd 39 查找文本忽略大小写 通过-i选项(忽略大小写), 将在搜索过程中忽略大小写. # grep -i [...]]]></description>
			<content:encoded><![CDATA[<p>Grep命令用于在文件中搜索特定的文本. 是一个具有许多选项的非常强大的命令.</p>
<blockquote><p>语法: grep [options] pattern [files]</p></blockquote>
<p><strong>我如何才能找到文件中匹配指定关键字的所有行?</strong><br />
在这个例子中, grep在/etc/passwd文件中查找包含文件John并显示所有的匹配行.</p>
<blockquote><p># grep John /etc/passwd<br />
jsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bash<br />
jdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash</p></blockquote>
<p>选项 -v, 显示除匹配行外的所有行. 在下面的例子中, 显示/etc/passwd文件中未匹配John的所有记录行.</p>
<p>注释: 在/etc/passwd中有一些行是未包含单词John. 下面仅显示输出的第一行.</p>
<blockquote><p># grep -v John /etc/passwd<br />
jbourne:x:1084:1084:Jason Bourne:/home/jbourne:/bin/bash</p></blockquote>
<p><b>计算特定文件中文件模式的匹配行数</b><br />
<span id="more-592"></span></p>
<p>在下面的例子中, 显示/etc/passwd文件里包含John文本的总行数.</p>
<blockquote><p># grep -c John /etc/passwd<br />
2</p></blockquote>
<p><span style="color: #333333; ">你也可以通过-cv选项统计未匹配指定模式的总行数.</span></p>
<blockquote><p># grep -cv John /etc/passwd<br />
39</p></blockquote>
<p><b>查找文本忽略大小写</b><br />
通过-i选项(忽略大小写), 将在搜索过程中忽略大小写.</p>
<blockquote><p># grep -i john /etc/passwd<br />
jsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bash<br />
jdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash</p></blockquote>
<p><b>在所有子目录中搜索匹配项</b><br />
使用-r选项(递归)实现. 在下面的例子中, 在/home/users目录下的所有子目录中忽略大小写搜索文本&#8221;John&#8221;.</p>
<p>显示格式为&#8221;文件名: 匹配行&#8221;. 你也可以通过-l选项, 仅显示匹配的文件名.</p>
<blockquote><p># grep -ri john /home/users<br />
/home/users/subdir1/letter.txt:John, Thanks for your contribution.<br />
/home/users/name_list.txt:John Smith<br />
/home/users/name_list.txt:John Doe<br />
# grep -ril john /root<br />
/home/users/subdir1/letter.txt<br />
/home/users/name_list.txt</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/08/linux-hacks17-grep-command.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧16.使用转义符进行SSH会话统计</title>
		<link>http://www.aease.org/2009/07/linux-hacks16-ssh-session-statistics.html</link>
		<comments>http://www.aease.org/2009/07/linux-hacks16-ssh-session-statistics.html#comments</comments>
		<pubDate>Fri, 31 Jul 2009 15:11:05 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=589</guid>
		<description><![CDATA[通过如下步骤获得当前SSH会话一些有用的统计信息(该步骤仅对SSH2客户端有效). 1. 从本地主机登录远程主机 localhost$ ssh -l jsmith remotehost 2. 在远程主机上输入转义符 ~ 和 s . 将会显示许多关于当前连接SSH的有用的统计信息. remotehost$ [注释:  当你输入~s 命令时, 该命令并没有显示在屏幕上.] remote host: remotehost local host: localhost remote version: SSH-1.99-OpenSSH_3.9p1 local version: SSH-2.0-3.2.9.1 SSH Secure Shell (non-commercial) compressed bytes in: 1506 uncompressed bytes in: 1622 compressed bytes out: 4997 uncompressed bytes out: 5118 packets in: 15 [...]]]></description>
			<content:encoded><![CDATA[<p>通过如下步骤获得当前SSH会话一些有用的统计信息(该步骤仅对SSH2客户端有效).</p>
<p>1. 从本地主机登录远程主机</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost</p></blockquote>
<p>2. 在远程主机上输入转义符 ~ 和 s . 将会显示许多关于当前连接SSH的有用的统计信息.</p>
<blockquote><p>remotehost$ <span style="color: #ff0000;">[注释:  当你输入~s 命令时, 该命令并没有显示在屏幕上.]<br />
</span>remote host: remotehost<br />
local host: localhost<br />
remote version: SSH-1.99-OpenSSH_3.9p1<br />
local version: SSH-2.0-3.2.9.1 SSH Secure Shell (non-commercial)<br />
compressed bytes in: 1506<br />
uncompressed bytes in: 1622<br />
compressed bytes out: 4997<br />
uncompressed bytes out: 5118<br />
packets in: 15<br />
packets out: 24<br />
rekeys: 0<br />
Algorithms:<br />
Chosen key exchange algorithm: diffie-hellman-group1-sha1<br />
Chosen host key algorithm: ssh-dss<br />
Common host key algorithms: ssh-dss,ssh-rsa<br />
Algorithms client to server:<br />
Cipher: aes128-cbc<br />
MAC: hmac-sha1<br />
Compression: zlib<br />
Algorithms server to client:<br />
Cipher: aes128-cbc<br />
MAC: hmac-sha1<br />
Compression: zlib<br />
localhost$</p></blockquote>
<p>更多SSH信息<br />
配置基于SSH密钥的身份验证, 请参考<a href="http://www.thegeekstuff.com/2008/06/perform-ssh-and-scp-without-entering-password-on-openssh/" target="_blank">openSSH</a>和<a href="http://www.thegeekstuff.com/2008/06/comprehensive-guide-for-ssh2-key-based-authentication-setup/" target="_blank">SSH2</a>的教程.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hacks16-ssh-session-statistics.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧15.使用SSH转义字符在会话间切换</title>
		<link>http://www.aease.org/2009/07/linux-hacks15-toggle-ssh-session.html</link>
		<comments>http://www.aease.org/2009/07/linux-hacks15-toggle-ssh-session.html#comments</comments>
		<pubDate>Thu, 30 Jul 2009 04:56:00 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=587</guid>
		<description><![CDATA[当从本地通过SSH登录到远程主机, 可能需要回到本地执行某些活动, 且在结束后返回远程主机. 在本示例中, 不需要断开远程SSH会话, 操作步骤如下: 1. 从本地登录远程主机: localhost$ ssh -l jsmith remotehost 2. 现在已连接到远程主机: remotehost$ 3. 临时返回本地, 键入转义符 ~ 和 Control-Z. 当键入~后并不会马上在屏幕上显示, 直到输入 &#60;Control-Z&#62; 和 回车. remotehost$ ~^Z [1]+ Stopped ssh -l jsmith remotehost localhost$ 4. 现在返回本地主机, SSH远程主机会话做为一个典型的UNIX进程在后台运行: localhost$ jobs [1]+ Stopped ssh -l jsmith remotehost 5. 切换回SSH远程主机会话(不需要再次输入密码). localhost$ fg %1 ssh -l jsmith [...]]]></description>
			<content:encoded><![CDATA[<p>当从本地通过SSH登录到远程主机, 可能需要回到本地执行某些活动, 且在结束后返回远程主机. 在本示例中, 不需要断开远程SSH会话, 操作步骤如下:</p>
<p>1. 从本地登录远程主机:</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost</p></blockquote>
<p>2. 现在已连接到远程主机:</p>
<blockquote><p>remotehost$</p></blockquote>
<p>3. 临时返回本地, 键入转义符 ~ 和 Control-Z.<br />
当键入~后并不会马上在屏幕上显示, 直到输入 &lt;Control-Z&gt; 和 回车.</p>
<blockquote><p>remotehost$ ~^Z<br />
[1]+ Stopped ssh -l jsmith remotehost<br />
localhost$</p></blockquote>
<p>4. 现在返回本地主机, SSH远程主机会话做为一个典型的UNIX进程在后台运行:</p>
<blockquote><p>localhost$ jobs<br />
[1]+ Stopped ssh -l jsmith remotehost</p></blockquote>
<p>5. 切换回SSH远程主机会话(不需要再次输入密码).</p>
<blockquote><p>localhost$ fg %1<br />
ssh -l jsmith remotehost<br />
remotehost$</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hacks15-toggle-ssh-session.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧14.调试SSH客户端会话</title>
		<link>http://www.aease.org/2009/07/linux-hacks14-debug-ssh-session.html</link>
		<comments>http://www.aease.org/2009/07/linux-hacks14-debug-ssh-session.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:11:32 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=585</guid>
		<description><![CDATA[某些时候有必要利用调试信息去解决一些SSH连接问题. 通过-v选项显示调试信息. localhost$ ssh -l jsmith remotehost.example.com warning: Connecting to remotehost.example.com failed: No address associated to the name locaclhost$ ssh -v -l jsmith remotehost.example.com debug: SshConfig/sshconfig.c:2838/ssh2_parse_config_ext: Metaconfig parsing stopped at line 3. debug: SshConfig/sshconfig.c:637/ssh_config_set_param_verbose: Setting variable ‘VerboseMode’ to ‘FALSE’. debug: SshConfig/sshconfig.c:3130/ssh_config_read_file_ext: Read 17 params from config file. debug: Ssh2/ssh2.c:1707/main: User config file not found, using [...]]]></description>
			<content:encoded><![CDATA[<p>某些时候有必要利用调试信息去解决一些SSH连接问题. 通过-v选项显示调试信息.</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost.example.com<br />
warning: Connecting to remotehost.example.com failed: No address associated to the name</p></blockquote>
<blockquote><p>locaclhost$ ssh -v -l jsmith remotehost.example.com<br />
debug: SshConfig/sshconfig.c:2838/ssh2_parse_config_ext: Metaconfig parsing stopped at line 3.<br />
debug: SshConfig/sshconfig.c:637/ssh_config_set_param_verbose: Setting variable ‘VerboseMode’ to ‘FALSE’.<br />
debug: SshConfig/sshconfig.c:3130/ssh_config_read_file_ext: Read 17 params from config file.<br />
debug: Ssh2/ssh2.c:1707/main: User config file not found, using defaults. (Looked for ‘/home/jsmith/.ssh2/ssh2_config’)<br />
debug: Connecting to remotehost.example.com, port 22… (SOCKS not used)<br />
warning: Connecting to remotehost.example.com failed: No address associated to the name</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hacks14-debug-ssh-session.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧13.使用SSH登录远程主机</title>
		<link>http://www.aease.org/2009/07/linux-hacks13-using-ssh-login.html</link>
		<comments>http://www.aease.org/2009/07/linux-hacks13-using-ssh-login.html#comments</comments>
		<pubDate>Sun, 26 Jul 2009 13:30:09 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[1]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=579</guid>
		<description><![CDATA[当你从本机第一次登录远程主机时, 将会显示&#8221;未发现主机密钥&#8221;的消息, 但你可以通过选择&#8221;Yes&#8221;继续. 远程主机密钥将保存在你的根目录下的.ssh2/hostkeys目录, 如下所示: localhost$ ssh -l jsmith remotehost.example.com Host key not found from database. Key fingerprint: xabie-dezbc-manud-bartd-satsy-limit-nexiu-jambl-title-jarde- tuxum You can get a public key’s fingerprint by running % ssh-keygen -F publickey.pub on the keyfile. Are you sure you want to continue connecting (yes/no)? Yes Host key saved to /home/jsmith/.ssh2/hostkeys/key_22_remotehost.example.com.pub host key for remotehost.example.com, [...]]]></description>
			<content:encoded><![CDATA[<p>当你从本机第一次登录远程主机时, 将会显示&#8221;未发现主机密钥&#8221;的消息, 但你可以通过选择&#8221;Yes&#8221;继续. 远程主机密钥将保存在你的根目录下的.ssh2/hostkeys目录, 如下所示:</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost.example.com<br />
Host key not found from database.<br />
Key fingerprint:<br />
xabie-dezbc-manud-bartd-satsy-limit-nexiu-jambl-title-jarde-<br />
tuxum<br />
You can get a public key’s fingerprint by running<br />
% ssh-keygen -F publickey.pub<br />
on the keyfile.<br />
Are you sure you want to continue connecting (yes/no)? Yes<br />
Host key saved to<br />
/home/jsmith/.ssh2/hostkeys/key_22_remotehost.example.com.pub<br />
host key for remotehost.example.com, accepted by jsmith Mon<br />
May 26 2008 16:06:50 -0700<br />
jsmith@remotehost.example.com password:<br />
remotehost.example.com$</p></blockquote>
<p>当你第二次通过本机登录远程主机时,  将作为已知主机的SSH客户端, 只需输入密码.</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost.example.com<br />
jsmith@remotehost.example.com password: <br />
remotehost.example.com$</p></blockquote>
<p>出于某些原因, 在你第一次登录远程主机后, 远程主机更改了密钥, 你可能会收到如下所示的一条警告消息.</p>
<blockquote><p>这可能是因为如下一些原因:<br />
系统管理员在远程主机上升级/重新安装SSH服务<br />
有人正在进行恶意活动等等</p></blockquote>
<p><span id="more-579"></span></p>
<p>在上述消息中选择&#8221;Yes&#8221;前, 最好联系你的系统管理员确认并核实你的主机密钥是否正确.</p>
<blockquote><p>localhost$ ssh -l jsmith remotehost.example.com<br />
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
@       WARNING: HOST IDENTIFICATION HAS CHANGED!         @<br />
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!<br />
Someone could be eavesdropping on you right now (man-in-the-middle attack)!<br />
It is also possible that the host key has just been changed.<br />
Please contact your system administrator.<br />
Add correct host key to<br />
“/home/jsmith/.ssh2/hostkeys/key_22_remotehost.example.com.pu<br />
b”<br />
to get rid of this message.<br />
Received server key’s fingerprint:<br />
xabie-dezbc-manud-bartd-satsy-limit-nexiu-jambl-title-arde-<br />
tuxum<br />
You can get a public key’s fingerprint by running<br />
% ssh-keygen -F publickey.pub<br />
on the keyfile.<br />
Agent forwarding is disabled to avoid attacks by corrupted<br />
servers.<br />
Are you sure you want to continue connecting (yes/no)? yes<br />
Do you want to change the host key on disk (yes/no)? yes<br />
Agent forwarding re-enabled.<br />
Host key saved to<br />
/home/jsmith/.ssh2/hostkeys/key_22_remotehost.example.com.pub<br />
host key for remotehost.example.com, accepted by jsmith Mon<br />
May 26 2008 16:17:31 -0700<br />
jsmith @remotehost.example.com’s password: <br />
remotehost$</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hacks13-using-ssh-login.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧12.检查SSH客户端版本</title>
		<link>http://www.aease.org/2009/07/linux-hack12-identify-ssh-client-ver.html</link>
		<comments>http://www.aease.org/2009/07/linux-hack12-identify-ssh-client-ver.html#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:38:42 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=577</guid>
		<description><![CDATA[有时候我们需要检查当前运行的SSH客户端的版本号. 使用ssh -V检查版本号. 注意Linux使用的是OpenSSH. 下面例子表明一个使用OpenSSH的特定系统: $ ssh -V OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 下面例子表明一个使用SSH2的特定系统: $ ssh -V ssh: SSH Secure Shell 3.2.9.1 (non-commercial version) on i686-pc-linux-gnu]]></description>
			<content:encoded><![CDATA[<p>有时候我们需要检查当前运行的SSH客户端的版本号. 使用ssh -V检查版本号. 注意Linux使用的是OpenSSH.</p>
<p>下面例子表明一个使用OpenSSH的特定系统:</p>
<blockquote><p>$ ssh -V<br />
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003</p></blockquote>
<p>下面例子表明一个使用SSH2的特定系统:</p>
<blockquote><p>$ ssh -V<br />
ssh: SSH Secure Shell 3.2.9.1 (non-commercial version) on i686-pc-linux-gnu</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hack12-identify-ssh-client-ver.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧11. 显示将来的时间</title>
		<link>http://www.aease.org/2009/07/linux-hack11-display-future-date.html</link>
		<comments>http://www.aease.org/2009/07/linux-hack11-display-future-date.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 14:35:31 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=572</guid>
		<description><![CDATA[date命令使用各种不同的方法显示将来的时间: $ date Thu Jan 1 08:30:07 PST 2009 $ date &#8211;date=&#8217;3 seconds&#8217; Thu Jan 1 08:30:12 PST 2009 $ date &#8211;date=&#8217;4 hours&#8217; Thu Jan 1 12:30:17 PST 2009 $ date &#8211;date=&#8217;tomorrow&#8217; Fri Jan 2 08:30:25 PST 2009 $ date &#8211;date=&#8221;1 day&#8221; Fri Jan 2 08:30:31 PST 2009 $ date &#8211;date=&#8221;1 days&#8221; Fri Jan 2 [...]]]></description>
			<content:encoded><![CDATA[<p>date命令使用各种不同的方法显示将来的时间:</p>
<blockquote><p>$ date<br />
Thu Jan 1 08:30:07 PST 2009</p></blockquote>
<blockquote></blockquote>
<blockquote><p>$ date &#8211;date=&#8217;3 seconds&#8217;<br />
Thu Jan 1 08:30:12 PST 2009</p>
<p>$ date &#8211;date=&#8217;4 hours&#8217;<br />
Thu Jan 1 12:30:17 PST 2009</p>
<p>$ date &#8211;date=&#8217;tomorrow&#8217;<br />
Fri Jan 2 08:30:25 PST 2009</p>
<p>$ date &#8211;date=&#8221;1 day&#8221;<br />
Fri Jan 2 08:30:31 PST 2009</p>
<p>$ date &#8211;date=&#8221;1 days&#8221;<br />
Fri Jan 2 08:30:38 PST 2009</p>
<p>$ date &#8211;date=&#8221;2 days&#8221;<br />
Sat Jan 3 08:30:43 PST 2009</p>
<p>$ date &#8211;date=&#8217;1 month&#8217;<br />
Sun Feb 1 08:30:48 PST 2009</p>
<p>$ date &#8211;date=&#8217;1 week&#8217;<br />
Thu Jan 8 08:30:53 PST 2009</p>
<p>$ date &#8211;date=&#8221;2 months&#8221;<br />
Sun Mar 1 08:30:58 PST 2009</p>
<p>$ date &#8211;date=&#8221;2 years&#8221;<br />
Sat Jan 1 08:31:03 PST 2011</p>
<p>$ date &#8211;date=&#8221;next day&#8221;<br />
Fri Jan 2 08:31:10 PST 2009</p>
<p><span style="color: #333333;">$ date &#8211;date=&#8221;-1 days ago&#8221;<br />
Fri Jan 2 08:31:15 PST 2009</span></p>
<p><span style="color: #333333;"><br />
$ date &#8211;date=&#8221;this Wednesday&#8221;<br />
Wed Jan 7 00:00:00 PST 2009</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hack11-display-future-date.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧10.显示过去时间</title>
		<link>http://www.aease.org/2009/07/linux-hack10-display-post-date.html</link>
		<comments>http://www.aease.org/2009/07/linux-hack10-display-post-date.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 14:29:38 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=569</guid>
		<description><![CDATA[date命令使用各种不同的方法显示过去的时间: $ date &#8211;date=&#8217;3 seconds ago&#8217; Thu Jan 1 08:27:00 PST 2009 $ date &#8211;date=&#8221;1 day ago&#8221; Wed Dec 31 08:27:13 PST 2008 $ date &#8211;date=&#8221;1 days ago&#8221; Wed Dec 31 08:27:18 PST 2008 $ date &#8211;date=&#8221;1 month ago&#8221; Mon Dec 1 08:27:23 PST 2008 $ date &#8211;date=&#8221;1 year ago&#8221; Tue Jan 1 08:27:28 PST [...]]]></description>
			<content:encoded><![CDATA[<p>date命令使用各种不同的方法显示过去的时间:</p>
<blockquote><p>$ date &#8211;date=&#8217;3 seconds ago&#8217;<br />
Thu Jan 1 08:27:00 PST 2009</p>
<p>$ date &#8211;date=&#8221;1 day ago&#8221;<br />
Wed Dec 31 08:27:13 PST 2008</p>
<p>$ date &#8211;date=&#8221;1 days ago&#8221;<br />
Wed Dec 31 08:27:18 PST 2008</p>
<p>$ date &#8211;date=&#8221;1 month ago&#8221;<br />
Mon Dec 1 08:27:23 PST 2008</p>
<p>$ date &#8211;date=&#8221;1 year ago&#8221;<br />
Tue Jan 1 08:27:28 PST 2008</p>
<p>$ date &#8211;date=&#8221;yesterday&#8221;<br />
Wed Dec 31 08:27:34 PST 2008</p>
<p>$ date &#8211;date=&#8221;10 months 2 day ago&#8221;<br />
Thu Feb 28 08:27:41 PST 2008</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hack10-display-post-date.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧9.格式化显示当前时间</title>
		<link>http://www.aease.org/2009/07/linux-hack9-format-date.html</link>
		<comments>http://www.aease.org/2009/07/linux-hack9-format-date.html#comments</comments>
		<pubDate>Sun, 19 Jul 2009 15:17:40 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=567</guid>
		<description><![CDATA[通过指定各种不同的格式显示当然时间: $ date Thu Jan 1 08:19:23 PST 2009 $ date &#8211;date=&#8221;now&#8221; Thu Jan 1 08:20:05 PST 2009 $ date &#8211;date=&#8221;today&#8221; Thu Jan 1 08:20:12 PST 2009 $ date &#8211;date=&#8217;1970-01-01 00:00:01 UTC +5 hours&#8217; +%s 18001 $ date &#8216;+Current Date: %m/%d/%y%nCurrent Time:%H:%M:%S&#8217; Current Date: 01/01/09 Current Time:08:21:41 $ date +&#8221;%d-%m-%Y&#8221; 01-01-2009 $ date +&#8221;%d/%m/%Y&#8221; 01/01/2009 [...]]]></description>
			<content:encoded><![CDATA[<p>通过指定各种不同的格式显示当然时间:</p>
<blockquote><p>$ date<br />
Thu Jan 1 08:19:23 PST 2009</p>
<p>$ date &#8211;date=&#8221;now&#8221;<br />
Thu Jan 1 08:20:05 PST 2009</p>
<p>$ date &#8211;date=&#8221;today&#8221;<br />
Thu Jan 1 08:20:12 PST 2009</p>
<p>$ date &#8211;date=&#8217;1970-01-01 00:00:01 UTC +5 hours&#8217; +%s<br />
18001</p>
<p>$ date &#8216;+Current Date: %m/%d/%y%nCurrent Time:%H:%M:%S&#8217;<br />
Current Date: 01/01/09<br />
Current Time:08:21:41</p>
<p>$ date +&#8221;%d-%m-%Y&#8221;<br />
01-01-2009</p>
<p>$ date +&#8221;%d/%m/%Y&#8221;<br />
01/01/2009</p>
<p>$ date +&#8221;%A,%B %d %Y&#8221;<br />
Thursday,January 01 2009</p></blockquote>
<p>date命令参数格式选项:</p>
<blockquote><p>o %D    日期 (mm/dd/yy)<br />
o %d    月中的日期 (01..31)<br />
o %m    月份 (01..12)<br />
o %y    年份的后两位数 (00..99)<br />
o %a    星期名称缩写 (Sun..Sat)<br />
o %A    星期名称全称 (Sunday..Saturday)<br />
o %b    月份名称缩写 (Jan..Dec)<br />
o %B    月份名称全称 (January..December)<br />
o %H    24小时制 (00..23)<br />
o %I    12小时制 (01..12)<br />
o %Y    年份 (1970…)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hack9-format-date.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux技巧8.设置硬件时间</title>
		<link>http://www.aease.org/2009/07/linux-hack-set-hardware-date.html</link>
		<comments>http://www.aease.org/2009/07/linux-hack-set-hardware-date.html#comments</comments>
		<pubDate>Sat, 18 Jul 2009 15:03:09 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[101个技巧]]></category>
		<category><![CDATA[101 Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.aease.org/?p=564</guid>
		<description><![CDATA[在设置硬件时间前, 务必将操作系统时间设置正确(参照Linux技巧7.设置系统日期和时间). 基于系统时间设置硬件的日期和时间: # hwclock –systohc # hwclock &#8211;systohc –utc 使用没带参数的hwclock命令显示当然硬件时间: # hwclock 检查时钟文件检验系统是否设置为UTC: # cat /etc/sysconfig/clock ZONE=&#8221;America/Los_Angeles&#8221; UTC=false ARC=false]]></description>
			<content:encoded><![CDATA[<p>在设置硬件时间前, 务必将操作系统时间设置正确(参照<a href="http://www.aease.org/?p=561" target="_blank">Linux技巧7.设置系统日期和时间</a>).</p>
<p>基于系统时间设置硬件的日期和时间:</p>
<blockquote><p># hwclock –systohc<br />
# hwclock &#8211;systohc –utc</p></blockquote>
<p>使用没带参数的hwclock命令显示当然硬件时间:</p>
<blockquote><p># hwclock</p></blockquote>
<p>检查时钟文件检验系统是否设置为UTC:</p>
<blockquote><p># cat /etc/sysconfig/clock<br />
ZONE=&#8221;America/Los_Angeles&#8221;<br />
UTC=false<br />
ARC=false</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/07/linux-hack-set-hardware-date.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
