<?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://xiaobin.net/category/tech/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://xiaobin.net</link>
	<description>一个社交恐惧症患者（俗称：宅男）的互联网从业生活</description>
	<lastBuildDate>Mon, 05 Jul 2010 03:12:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Vim+XDebug调试PHP</title>
		<link>http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/</link>
		<comments>http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 04:39:00 +0000</pubDate>
		<dc:creator>肖斌</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[Xdebug]]></category>

		<guid isPermaLink="false">http://xiaobin.net/?p=415</guid>
		<description><![CDATA[感谢老黑和鸟哥发布的《PHP调试指南》(via)。要不是他们，我可能还在用echo/var_dump调试PHP代码。是他们解救了我，引导我走向光明，感激涕零中……本文是对指南中的《Vim + Xdebug + DBGp》一章的一些补充。 原理上，这种调试方式主要依靠Vim的插件“remote PHP debugger”来实现，该插件实现了一个DBGP服务端。调试的时候Xdebug将会与服务端建立一个连接进行通信，接收服务端的调试指令并返回调试结果。 安装和配置 XDebug 安装： 机器上装有pecl，运行&#8221;pecl install xdebug&#8221;就会编译好xdebug.so； 没装pecl则需下载Xdebug源码编译安装。过程简单，见《Compiling shared PECL extensions with phpize》； 配置： 加载Xdebug扩展： zend_extension=/&#60;extension_dir&#62;/xdebug.so 配置xdebug开启dbgp远程调试 xdebug.remote_enable=on xdebug.remote_handler=dbgp Vim的Debugger插件 这个简单，只需要将插件下载回来，解压放到~/.vim/plugin目录 调试过程 用Vim打开要调试的PHP文件，按&#60;F5&#62;进入调试状态。请移步《PHP调试指南》，上面写的详细一些。 注意事项 实际过程中，如果你发现安装完成仍然无法正常的调试PHP，极可能是下面的原因造成的： 一、Xdebug加载不成功 可以通过phpinfo或者是&#8221;php -m&#8221;来确认Xdebug是不是加载成功。加载不成功的原因可能是由于PHP是&#8221;Debug Build&#8221;（可以通过phpinfo确认），那么php.ini里不应当用“zend_extension=/&#60;extension_dir&#62;/xdebug.so”，而应该用“zend_extension_debug=/&#60;extension_dir&#62;/xdebug.so”； 其它方面就是要注意xdebug.so路径是否正确，Apache服务或者是fastcgi服务有没有重启。 二、 调试会话已经过期 XDebug 通过一个Cookie来判断你是否进行调试对话，请注意这个Cookie的过期时间是1个小时。某天你埋头工作的时候发现Vim + Xdebug刚刚还work，怎么一下又不work了，那多半是由于这个会话已经过期了。 只要在URL后面带上参数 &#8220;XDEBUG_SESSION_START=1&#8243;，调试会话就会延续1小时。 三、SeLinux 我是比较痛恨SeLinux的，因为它总是在意想不到情况下出现，每次都会给带来一些“惊喜”。如果你是在Linux+Apache + mod_php 环境用Vim + Xdebug调试PHP，那难免要注意了： 要么你永远关闭SeLinux——开发机打开SeLinux没有太大的意义： 修改配置文件/etc/selinux/config，将&#8221;SELINUX=&#8221;那一句配置改成&#8221;SELINUX=disabled&#8221;，然后重启机器。 要么，放httpd一条生路，允许它访问网络： [...]]]></description>
			<content:encoded><![CDATA[<p>感谢<a href="http://blog.csdn.net/heiyeshuwu" target="_blank">老黑</a>和<a href="http://www.laruence.com/" target="_blank">鸟哥</a>发布的《<a href="http://heiyeluren-doc.googlecode.com/files/PHP-Debug-Manual-public.pdf" target="_blank">PHP调试指南</a>》(<a href="http://www.laruence.com/2010/06/21/1608.html" target="_blank">via</a>)。要不是他们，我可能还在用echo/var_dump调试PHP代码。是他们解救了我，引导我走向光明，感激涕零中……本文是对指南中的《Vim + Xdebug + DBGp》一章的一些补充。</p>
<p>原理上，这种调试方式主要依靠Vim的插件“<a href="http://www.vim.org/scripts/script.php?script_id=1152" target="_blank">remote PHP debugger</a>”来实现，该插件实现了一个<a href="http://xdebug.org/docs-dbgp.php" target="_blank">DBGP</a>服务端。调试的时候Xdebug将会与服务端建立一个连接进行通信，接收服务端的调试指令并返回调试结果。<span id="more-415"></span></p>
<h3>安装和配置</h3>
<p><strong>XDebug</strong></p>
<p><strong><span style="font-weight: normal;">安装：</span></strong></p>
<ul>
<li>机器上装有<a href="http://pecl.php.net/" target="_blank">pecl</a>，运行&#8221;pecl install xdebug&#8221;就会编译好xdebug.so；</li>
<li>没装pecl则需下载<a href="http://pecl.php.net/package/Xdebug" target="_blank">Xdebug源码</a>编译安装。过程简单，见《<a href="http://php.net/manual/en/install.pecl.phpize.php" target="_blank">Compiling shared PECL extensions with phpize</a>》；</li>
</ul>
<p>配置：</p>
<ul>
<li>加载Xdebug扩展：<br />
<blockquote><p>zend_extension=/&lt;extension_dir&gt;/xdebug.so</p></blockquote>
</li>
<li>配置xdebug开启dbgp远程调试<br />
<blockquote><p>xdebug.remote_enable=on<br />
xdebug.remote_handler=dbgp</p></blockquote>
</li>
</ul>
<p><strong>Vim的Debugger插件</strong></p>
<p><strong><span style="font-weight: normal;">这个简单，只需要将插件下载回来，解压放到~/.vim/plugin目录</span><br />
</strong></p>
<h3>调试过程</h3>
<p>用Vim打开要调试的PHP文件，按&lt;F5&gt;进入调试状态。请移步《<a href="http://heiyeluren-doc.googlecode.com/files/PHP-Debug-Manual-public.pdf" target="_blank">PHP调试指南</a>》，上面写的详细一些。</p>
<h3>注意事项</h3>
<p>实际过程中，如果你发现安装完成仍然无法正常的调试PHP，极可能是下面的原因造成的：</p>
<p>一、<span style="font-weight: bold;">Xdebug加载不成功</span></p>
<p>可以通过phpinfo或者是&#8221;php -m&#8221;来确认Xdebug是不是加载成功。加载不成功的原因可能是由于PHP是&#8221;Debug Build&#8221;（可以通过phpinfo确认），那么php.ini里不应当用“zend_extension=/<span style="font-style: italic;">&lt;extension_dir&gt;</span>/xdebug.so”，而应该用“zend_extension<span style="color: #ff0000;">_debug</span>=/<span style="font-style: italic;">&lt;extension_dir&gt;</span>/xdebug.so”；</p>
<p>其它方面就是要注意xdebug.so路径是否正确，Apache服务或者是fastcgi服务有没有重启。</p>
<p><strong>二、 调试会话已经过期</strong></p>
<p>XDebug 通过一个Cookie来判断你是否进行调试对话，请注意这个Cookie的过期时间是1个小时。某天你埋头工作的时候发现Vim + Xdebug刚刚还work，怎么一下又不work了，那多半是由于这个会话已经过期了。</p>
<p>只要在URL后面带上参数 &#8220;XDEBUG_SESSION_START=1&#8243;，调试会话就会延续1小时。</p>
<p><strong>三、SeLinux</strong></p>
<p>我是比较痛恨SeLinux的，因为它总是在意想不到情况下出现，每次都会给带来一些“惊喜”。如果你是在Linux+Apache + mod_php 环境用Vim + Xdebug调试PHP，那难免要注意了：</p>
<p>要么你永远关闭SeLinux——开发机打开SeLinux没有太大的意义：</p>
<blockquote><p>修改配置文件/etc/selinux/config，将&#8221;SELINUX=&#8221;那一句配置改成&#8221;SELINUX=disabled&#8221;，然后重启机器。</p></blockquote>
<p>要么，放httpd一条生路，允许它访问网络：</p>
<blockquote><p>执行Shell命令&#8221;setsebool -P httpd_can_network_connect=1&#8243;，然后重启Apache。</p></blockquote>
<p><strong>四、断点位置不正确</strong></p>
<p>断点位置不正确的情况下按&lt;F4&gt;，调试器根本不会在你所设置的断点暂停；如图这样的一段代码：<br />
<a href="http://big5.cc/i/xbin/2010/07/breakboint.jpg"><img class="aligncenter size-full wp-image-434" title="断点调试" src="http://big5.cc/i/xbin/2010/07/breakboint.jpg" alt="" width="178" height="114" /></a><br />
2-6行设置了5个断点，实际会发现，调试器会跳过其它行，只会第5行暂停。所以断点的位置也要注意。</p>
<h3>参考和延伸阅读</h3>
<ol>
<li><a href="http://2bits.com/articles/using-vim-and-xdebug-dbgp-for-debugging-drupal-or-any-php-application.html" target="_blank">Using vim and xdebug DBGp for debugging Drupal (or any PHP application)</a></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1152" target="_blank">remote PHP debugger</a></li>
</ol>
<hr />
<p><strong><a href="http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/">Vim+XDebug调试PHP</a></strong> | 暂无评论，<a href="http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/#comments">添加评论</a>
<br>本文网址：<a href="http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/">http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/</a>
<br><a href="http://xiaobin.net">将之典藏</a> - 厚积而薄发，© 2005-2010. 如无特别声明，适用<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank">署名-非商业性使用-相同方式共享 3.0</a>授权，你可以署名使用全部或者部分内容用于非商业性目的。</p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>批量文件编码转换</title>
		<link>http://xiaobin.net/201004/convert-file-encoding-under-linux/</link>
		<comments>http://xiaobin.net/201004/convert-file-encoding-under-linux/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:05:18 +0000</pubDate>
		<dc:creator>肖斌</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://xiaobin.net/?p=355</guid>
		<description><![CDATA[脚本文件 convert.sh： #!/bin/sh convert() { echo -ne "convert $1 ...\n" file -i $1 &#124; awk -F = '$2 != "utf-8" &#38;&#38; $2 != "unknown" {\ print "iconv -f gb2312 -t utf-8 -o '$1'.tmp '$1'"\ }' &#124; sh [ -f ""$1.tmp"" ] &#38;&#38; mv "$1.tmp" $1 } run() { for file in `find $1 -type f [...]]]></description>
			<content:encoded><![CDATA[<p>脚本文件 convert.sh：</p>
<pre>#!/bin/sh
convert() {
    echo -ne "convert $1 ...\n"
    file -i $1 | awk -F = '$2 != "utf-8" &amp;&amp; $2 != "unknown" {\
        print "iconv -f gb2312 -t utf-8 -o '$1'.tmp '$1'"\
    }' | sh
    [ -f ""$1.tmp"" ] &amp;&amp; mv "$1.tmp" $1
}

run() {
    for file in `find $1 -type f -name "*.php" | grep -v bbs`
    do
        convert $file
    done
}

run $1
</pre>
<p>./convert.sh uchome/</p>
<hr />
<p><strong><a href="http://xiaobin.net/201004/convert-file-encoding-under-linux/">批量文件编码转换</a></strong> | 暂无评论，<a href="http://xiaobin.net/201004/convert-file-encoding-under-linux/#comments">添加评论</a>
<br>本文网址：<a href="http://xiaobin.net/201004/convert-file-encoding-under-linux/">http://xiaobin.net/201004/convert-file-encoding-under-linux/</a>
<br><a href="http://xiaobin.net">将之典藏</a> - 厚积而薄发，© 2005-2010. 如无特别声明，适用<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank">署名-非商业性使用-相同方式共享 3.0</a>授权，你可以署名使用全部或者部分内容用于非商业性目的。</p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用trash代替rm</title>
		<link>http://xiaobin.net/200912/replace-rm-command-with-trash/</link>
		<comments>http://xiaobin.net/200912/replace-rm-command-with-trash/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 09:15:20 +0000</pubDate>
		<dc:creator>肖斌</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://xiaobin.net/?p=220</guid>
		<description><![CDATA[在/usr/bin/目录创建一个trash文件： #! /bin/sh DATE=`date +%Y%m%d` TRASH="$HOME/.trash" # Make sure the dest directionry is exists. if [ ! -d $TRASH ]; then mkdir $TRASH if [ ! -z $SUDO_USER ]; then chown $SUDO_USER $TRASH chgrp $SUDO_GID $TRASH fi fi if [ ! -d $TRASH/$DATE ]; then mkdir $TRASH/$DATE if [ ! -z $SUDO_USER ]; then chown [...]]]></description>
			<content:encoded><![CDATA[<p>在/usr/bin/目录创建一个trash文件：</p>
<pre>#! /bin/sh

DATE=`date +%Y%m%d`
TRASH="$HOME/.trash"

# Make sure the dest directionry is exists.
if [ ! -d $TRASH ]; then
    mkdir $TRASH
    if [ ! -z $SUDO_USER ]; then
        chown $SUDO_USER $TRASH
        chgrp $SUDO_GID $TRASH
    fi
fi

if [ ! -d $TRASH/$DATE ]; then
    mkdir $TRASH/$DATE
    if [ ! -z $SUDO_USER ]; then
        chown $SUDO_USER $TRASH/$DATE
        chgrp $SUDO_GID $TRASH/$DATE
    fi
fi

while [ $# -gt 0 ]
do
    if [ `expr substr $1 1 1` = "-" ]; then
        if [ $1 = "--" ]; then
            shift
            break
        fi
        shift
    else
        break
    fi
done
if [ $# -gt 0 ]; then
    mv $* $TRASH/$DATE
fi</pre>
<p>之后，只要把&#8221;alias rm=trash&#8221;放进bashrc就可以了。</p>
<hr />
<p><strong><a href="http://xiaobin.net/200912/replace-rm-command-with-trash/">使用trash代替rm</a></strong> | 暂无评论，<a href="http://xiaobin.net/200912/replace-rm-command-with-trash/#comments">添加评论</a>
<br>本文网址：<a href="http://xiaobin.net/200912/replace-rm-command-with-trash/">http://xiaobin.net/200912/replace-rm-command-with-trash/</a>
<br><a href="http://xiaobin.net">将之典藏</a> - 厚积而薄发，© 2005-2009. 如无特别声明，适用<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank">署名-非商业性使用-相同方式共享 3.0</a>授权，你可以署名使用全部或者部分内容用于非商业性目的。</p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables应用实例</title>
		<link>http://xiaobin.net/200912/iptables-example/</link>
		<comments>http://xiaobin.net/200912/iptables-example/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 09:23:12 +0000</pubDate>
		<dc:creator>肖斌</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://xiaobin.net/?p=160</guid>
		<description><![CDATA[本机端口转发 将本机80端口的请求转发到8080端口： iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 如果需要本机也可以访问，则需要配置OUTPUT链： iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080 原因：外网访问需要经过PREROUTING链，但是localhost不经过该链，因此需要用OUTPUT，或者POSTROUTING。 以上规则可以通过 iptables -t nat -F PREROUTING(或者是OUTPUT)清除 两机之间的端口转发 将本机的81端口的请求全部转发到192.168.1.1:80 首先要启用ipv4的转发功能： echo 1 &#62; /proc/sys/net/ipv4/ip_forward 或者是修改/etc/sysctl.conf (via)以便重启后也会启用转发，然后设定iptables(via)： iptables -t nat -A PREROUTING -p tcp --dport [...]]]></description>
			<content:encoded><![CDATA[<h3>本机端口转发</h3>
<p>将本机80端口的请求转发到8080端口：</p>
<pre>iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080</pre>
<p><span id="more-160"></span>如果需要本机也可以访问，则需要配置OUTPUT链：</p>
<pre>iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080</pre>
<p>原因：外网访问需要经过PREROUTING链，但是localhost不经过该链，因此需要用OUTPUT，或者POSTROUTING。</p>
<p>以上规则可以通过 iptables -t nat -F PREROUTING<em><span style="color: #c0c0c0;">(或者是OUTPUT)</span></em>清除</p>
<h3>两机之间的端口转发</h3>
<p>将本机的81端口的请求全部转发到192.168.1.1:80</p>
<p>首先要启用ipv4的转发功能：</p>
<pre>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre>
<p>或者是修改/etc/sysctl.conf (<a href="http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/" target="_blank">via</a>)以便重启后也会启用转发，然后设定iptables(<a href="http://serverfault.com/questions/27221/iptables-port-forwarding-on-debian" target="_blank">via</a>)：</p>
<pre>iptables -t nat -A PREROUTING -p tcp --dport <span style="color: #ff0000;">81</span> -j DNAT --to <span style="color: #ff0000;">192.168.1.1:80</span>
iptables -t nat -A POSTROUTING -j MASQUERADE</pre>
<p>如果开启了防火墙功能，注意要将80和81两个端口都打开。</p>
<h3>禁止Ping入</h3>
<p>允许内网(192.168.1.*)的ping入，允许ping出，禁止其它网段的ping入</p>
<pre>iptables -A INPUT -p icmp --icmp-type 8 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 8 -j DROP</pre>
<hr />
<p><strong><a href="http://xiaobin.net/200912/iptables-example/">iptables应用实例</a></strong> | 暂无评论，<a href="http://xiaobin.net/200912/iptables-example/#comments">添加评论</a>
<br>本文网址：<a href="http://xiaobin.net/200912/iptables-example/">http://xiaobin.net/200912/iptables-example/</a>
<br><a href="http://xiaobin.net">将之典藏</a> - 厚积而薄发，© 2005-2009. 如无特别声明，适用<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank">署名-非商业性使用-相同方式共享 3.0</a>授权，你可以署名使用全部或者部分内容用于非商业性目的。</p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tar: Removing leading `/&#8217; from member names</title>
		<link>http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/</link>
		<comments>http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 11:23:43 +0000</pubDate>
		<dc:creator>肖斌</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://xiaobin.net/?p=183</guid>
		<description><![CDATA[首先应该明确：*nix系统中，使用tar对文件打包时，一般不建议使用绝对路径。 通常是在两台环境相似的机器上进行同步复制的时候，才有需要使用绝对路径进行打包。使用绝对路径打包时如果不指定相应的参数，tar会产生一句警告信息：&#8221;tar: Removing leading `/&#8217; from member names&#8221;，并且实际产生的压缩包会将绝对路径转化为相对路径。 比如： root@queen ~ # tar -czvf robin.tar.gz /home/robin tar: Removing leading `/' from member names /home/robin/ /home/robin/file1 /home/robin/file2 /home/robin/file3 root@queen ~ # tar -tzvf robin.tar.gz drwxr-xr-x robin/root 0 2009-11-10 18:51:31 home/robin/ -rw-r--r-- robin/root 0 2009-11-10 18:51:28 home/robin/file1 -rw-r--r-- robin/root 0 2009-11-10 18:51:30 home/robin/file2 -rw-r--r-- robin/root 0 2009-11-10 [...]]]></description>
			<content:encoded><![CDATA[<p>首先应该明确：*nix系统中，使用tar对文件打包时，一般不建议使用绝对路径。</p>
<p>通常是在两台环境相似的机器上进行同步复制的时候，才有需要使用绝对路径进行打包。使用绝对路径打包时如果不指定相应的参数，tar会产生一句警告信息：&#8221;tar: Removing leading `/&#8217; from member names&#8221;，并且实际产生的压缩包会将绝对路径转化为相对路径。<span id="more-183"></span></p>
<p>比如：</p>
<pre>root@queen ~ # tar -czvf robin.tar.gz <span style="color: #ff0000;">/home/robin</span>
tar: Removing leading `/' from member names
/home/robin/
/home/robin/file1
/home/robin/file2
/home/robin/file3
root@queen ~ # tar -tzvf robin.tar.gz
drwxr-xr-x robin/root        0 2009-11-10 18:51:31 <span style="color: #ff0000;">home/robin/</span>
-rw-r--r-- robin/root        0 2009-11-10 18:51:28 home/robin/file1
-rw-r--r-- robin/root        0 2009-11-10 18:51:30 home/robin/file2
-rw-r--r-- robin/root        0 2009-11-10 18:51:31 home/robin/file3
root@queen ~ #</pre>
<p>这样的一个压缩包，如果我们再去解开，就会当前目录（也即此例中的“~”）下再新建出“./home/robin/” 两级目录。对于这样的压缩包，解压方法是使用参数 “-C”指解压的目录为根目录（“/”）：tar -xzvf robin.tar.gz -C /</p>
<p>更为可靠的方法是在打包和解开的时候都使用参数 <span style="color: #ff0000;">-P</span>：</p>
<pre>root@queen ~ # tar -czv<span style="color: #ff0000;"><strong>P</strong></span>f robin.tar.gz /home/robin/
/home/robin/
/home/robin/file1
/home/robin/file2
/home/robin/file3
root@queen ~ # tar tzvf robin.tar.gz
drwxr-xr-x robin/root        0 2009-11-10 18:51:31 /home/robin/
-rw-r--r-- robin/root        0 2009-11-10 18:51:28 /home/robin/file1
-rw-r--r-- robin/root        0 2009-11-10 18:51:30 /home/robin/file2
-rw-r--r-- robin/root        0 2009-11-10 18:51:31 /home/robin/file3
root@queen ~ # tar -xzv<span style="color: #ff0000;"><strong>P</strong></span>f robin.tar.gz
/home/robin/
/home/robin/file1
/home/robin/file2
/home/robin/file3
root@queen ~ #</pre>
<hr />
<p><strong><a href="http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/">tar: Removing leading `/&#8217; from member names</a></strong> | 暂无评论，<a href="http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/#comments">添加评论</a>
<br>本文网址：<a href="http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/">http://xiaobin.net/200911/tar-removing-leading-slash-from-member-name/</a>
<br><a href="http://xiaobin.net">将之典藏</a> - 厚积而薄发，© 2005-2009. 如无特别声明，适用<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh" target="_blank">署名-非商业性使用-相同方式共享 3.0</a>授权，你可以署名使用全部或者部分内容用于非商业性目的。</p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
