Important note
There are two types of paths:
- Absolute path
- Relative path
Absolute path shows the location of a folder or a file from the root directory /
. In other words, it's a complete path from the very beginning of the filesystem to the target. Examples of absolute paths:
/Users/john/Documents/report.pdf
/home/craig/photos
Relative path shows the location of a folder or a file from the working (current) directory. For example, if you're in /Users/john/
right now, then Documents/report.pdf
is a relative path.
This is similar to a complete postal address (3500 Deer Creek Road. Palo Alto, CA 94304, United States of America — absolute path), or a incomplete postal address (5th ave., 12 — relative path, relative to the city you're in).
Lesson notes
- 'working directory' is your current directory
cd
is used to move- Unix-based file systems look like trees, with a root directory in the very beginning.
Recommended reading
- Bash (Unix shell) Wikipedia
Are there any more questions? Ask them in the Discussion section.
The Hexlet support team or other students will answer you.