关于目录中的单点和双点 [英] Regarding the Single and the Double Dot within Directories

查看:137
本文介绍了关于目录中的单点和双点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要我们使用以下命令:

Whenever we use the command:

dir --> in Windows

dir -a --> in Unix

我们看到2种点:

.
..

出现在目录中. 现在,在斯蒂芬斯·拉戈(Stephens Rago)的APUE中,它说这些是文件名,有些书说这些是目录.

Appear in the directories. Now in APUE by Stephens Rago, it says these are filenames and some books say these are directories.

这些点到底是什么? 请提供答案Windows和Unix(如果可能).

What are these Dots about anyway? Please provide an answer w.r.t. Windows as well as Unix if possible.

推荐答案

在两个平台(和基于Web的编程)上都相同

its the same for both platforms (and web based programming)

.代表您所在的目录,而..代表父目录.

. represents the directory you are in and .. represents the parent directory.

(如果您有文件),例如: http://example.com/blog/index. html ,并且您想要链接到图像 http://example.com/images/image .jpg ,您可以这样输入:

in HTML if you have a file eg: http://example.com/blog/index.html and you want to link to the image http://example.com/images/image.jpg you would put it in as such:

<img src="../images/image.jpg" />

这告诉脚本先在PARENT目录中查找,然后在images/image.jpg中查找.

As that tells the script to look in the PARENT directory and then images/image.jpg.

这篇关于关于目录中的单点和双点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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