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

前端之家收集整理的这篇文章主要介绍了linux – bash中/和//有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在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.

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

原文链接:https://www.f2er.com/linux/396540.html

猜你在找的Linux相关文章