就像标题所说的那样,绝对路径名和相对路径名之间有什么区别?我现在正在参加计算机组织课程,我参加的讲座是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
。
从这个理解,任何给定文件的相对路径基本上是你目前“站在”目录下的文件路径?