无法理解Zsh的autopushd的好处
我在.zshrc setopt autopushd 它使cd行为像pushd. 我不确定autopushd有什么好处. autopushd有什么好处? 解决方法pushd就像cd,但它也会将当前目录推送到堆栈.您可能位于/ some / deep /目录中,然后需要在/ var / www中查看一段时间:crb@server /some/deep/directory $pushd /var/www/ /var/www /some/deep/directory crb@server /var/www $[do some stuff] crb@server /var/www $popd /some/deep/directory crb@server /some/deep/directory $ autopushd意味着即使你输入’cd’,你也会得到输入’pushd’的效果,你不记得你想要使用它直到你想到“男人,我真的希望我能回到原来的状态”.然后,您可以回顾目录历史记录. 知道你可以通过输入’cd – ‘来改变你之前的目录(而不是父目录),这很有用. Here’s another good writeup. 编辑为什么在使用cd时使用pushd? cd /foo/bar cd /baz cd /somewhere/else cd – 只会让你到/ baz.在输入’cd / foo / bar’之前,pushd会让你一直回到原来的位置. 目录堆栈在脚本中特别有用,您不能只返回命令历史记录并识别您所在目录的名称: pushd /var/foo # run a command,which might well change your PWD at the end of its execution - especially if it fails popd 您现在可以保证在/ var / foo中. (编辑:PHP编程网 - 黄冈站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 如何在cygwin中运行crontab定时脚本[利刃篇]
- c – 在Linux上更换MS vsprintf_s?
- linux – 我的进程如何检测计算机是否正在关闭?
- 谷歌服务框架(google services framework)是什么 可以删除吗
- 确定两个文件路径是否指向Linux/C下的同一文件?
- “因所依赖的软件包未找到或存在冲突软件包”完美解决方案!
- Linux中执行shell程序的方法
- linux – 如何在github上为1个用户添加2个repo的部署密钥
- 10 Linux DIG Command Examples for DNS Lookup--reference
- 戴森出儿童版吸尘器?赚完女人钱还要收割孩子们