1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-03 13:15:25 +02:00
tldr/pages.zh/common/pushd.md

22 lines
578 B
Markdown
Raw Normal View History

2019-03-13 11:31:36 +08:00
# pushd
> 将目录放在堆栈上,以便以后访问。
> 另见 `popd` 切换回原始目录和 `dirs` 显示目录堆栈内容。
2025-04-22 13:43:26 +02:00
> 更多信息:<https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html#index-pushd>.
2019-03-13 11:31:36 +08:00
- 切换到目录并将其添加到堆栈上:
2019-03-13 11:31:36 +08:00
`pushd {{路径/到/目录}}`
2019-03-13 11:31:36 +08:00
- 切换堆栈上的第一个和第二个目录:
2019-03-13 11:31:36 +08:00
`pushd`
- 通过使第 5 个元素成为堆栈的顶部来旋转堆栈:
2019-03-13 11:31:36 +08:00
`pushd +4`
- 将堆栈向左旋转 4 次(当前目录通过替换第 5 个元素保持在顶部):
`pushd -n +4`