加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – bash中/和//有什么区别?

发布时间:2020-12-14 02:47:39 所属栏目:Linux 来源:网络整理
导读:在zsh中,输入任意数量的斜杠会将我移动到根目录中,但正如我最近注意到的那样,在bash中你可以进入//并且它实际上显示//而不是/. 之后(///…/)这一切都以/结尾. 有人可以告诉我这个的区别/意义是什么? 解决方法 见 Pathname resolution A pathname consisting
在zsh中,输入任意数量的斜杠会将我移动到根目录中,但正如我最近注意到的那样,在bash中你可以进入//并且它实际上显示//而不是/.

之后(///…/)这一切都以/结尾.

有人可以告诉我这个的区别/意义是什么?

解决方法

见 Pathname resolution

A pathname consisting of a single slash shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner,although more than two leading slashes shall be treated as a single slash.

大多数实现只是将//视为/,但仍可能显示//.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读