2019-03-13 03:31:36 +00:00
|
|
|
# pushd
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 将目录放在堆栈上,以便以后访问。
|
|
|
|
> 另请参阅 `popd` 命令说明,以切换回原始目录。
|
2023-11-06 17:44:12 +00:00
|
|
|
> 更多信息:<https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html>.
|
2019-03-13 03:31:36 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 切换到目录并将其添加到堆栈上:
|
2019-03-13 03:31:36 +00:00
|
|
|
|
|
|
|
`pushd {{directory}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 切换堆栈上的第一个和第二个目录:
|
2019-03-13 03:31:36 +00:00
|
|
|
|
|
|
|
`pushd`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 通过使第 5 个元素成为堆栈的顶部来旋转堆栈:
|
2019-03-13 03:31:36 +00:00
|
|
|
|
|
|
|
`pushd +4`
|