CD选项更改为previous目录 [英] cd option to change to previous directory

查看:126
本文介绍了CD选项更改为previous目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个完整的新手到bash脚本编程。
我记得有执行 CD 命令,自动返回到previous目录(没有明确的 CD ... )。
任何想法?


解决方案

如果你只是想回到上一层目录,你可以使用 CD -

如果您需要更多的地方回去,试试 PUSHD< D​​IR> (而不是 CD< D​​IR> ),然后你就可以回去与 POPD

I'm a complete newbie to bash scripting. I remember there was a way to execute the cd command, automatically returning to the previous directory (without an explicit cd ...). Any idea?

解决方案

If you just want to go back to the last directory, you can use cd -.

If you need more places to go back to, try pushd <dir> (instead of cd <dir>) and then you can go back with popd.

这篇关于CD选项更改为previous目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆