2019-04-21 11:50:48 +08:00

24 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="popd">popd</h1>
<p>用于删除目录栈中的记录</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>popd命令</strong> 用于删除目录栈中的记录如果popd命令不加任何参数则会先删除目录栈最上面的记录然后切换到删除过后的目录栈中的最上面的目录。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">pushd(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">+N将第N个目录删除从左边数起数字从0开始
-N将第N个目录删除从右边数起数字从0开始
-n将目录出栈时不切换目录。</code></pre>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">root@Mylinux:/tmp/dir4# popd相当于popd +0
/tmp/dir3 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir3# pushd /tmp/dir4
/tmp/dir4 /tmp/dir3 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir4# popd +1
/tmp/dir4 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir4# popd -2
/tmp/dir4 /tmp/dir1 ~</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->