什么是“光盘 - ”代表什么? [英] What does 'cd -' stand for?

查看:139
本文介绍了什么是“光盘 - ”代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个bash shell脚本今天我在脚本的末尾注意到下面的命令。我知道什么是 CD ,但我之后我不知道几许的意义。

In a bash shell script today I noticed the below command at the end of the script. I know what is cd but I am unaware of the significance of a dash after it.

cd -

这是什么意思?谷歌天真地截断 - 所以我无法找到答案的。

What does this mean? Google naively truncates the - so I am unable to find its answer.

推荐答案

如果一个破折号被指定为参数,它将被 OLDPWD 的值替换。

If a single dash is specified as the argument, it will be replaced by the value of OLDPWD.

OLDPWD 设置CD 命令,这是previous工作目录。

The OLDPWD is set by cd command and it is the previous working directory.

这篇关于什么是“光盘 - ”代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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