【发布时间】:2017-09-08 16:33:22
【问题描述】:
正如标题所说,绝对路径名和相对路径名有什么区别?我现在正在上计算机组织课程,我参加的讲座是关于 Unix 的速成课程。演讲幻灯片说:
The pathnames described in the previous slides start at the root.
These pathnames are called 'absolute pathnames'
作为参考,“以前的幻灯片”基本上显示了一个以根目录/为顶部节点的文件树。
后面的幻灯片说:
If we are in the directory /home/chrisc, the relative pathname of the
file 'syllabus' in the directory /home/chrisc/comporg/ is:
comporg/syllabus
我仍然对绝对路径名和相对路径名之间的区别感到困惑。例如,我在 Mac 上。我的根目录是/。要从 / 访问我的文档,我必须使用 cd /Users/Daniel/Documents。
在我的文档中,我需要访问一个名为 School 的文件夹。如果我想去School,我会做cd School。
根据这种理解,任何给定文件的相对路径基本上是您当前“站在”目录下的文件路径吗?
【问题讨论】: