mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 06:55:36 +08:00
24 lines
1.1 KiB
HTML
24 lines
1.1 KiB
HTML
<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/ -->
|