Register to get access to 15+ free programming courses with interactive exercises

Navigating the file system Basics of Bash

Video may be blocked due to browser extensions. In the article you will find a solution to this problem.

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.

Аватары экспертов Хекслета

Are there any more questions? Ask them in the Discussion section.

The Hexlet support team or other students will answer you.

Sign up

Programming courses for beginners and experienced developers. Start training for free

  • 130 courses, 2000+ hours of theory
  • 1000 practical tasks in a browser
  • 360 000 students
By sending the form, you agree to Personal Policy and Service Conditions

Our graduates work in companies:

<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.bookmate">Bookmate</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.healthsamurai">Healthsamurai</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.dualboot">Dualboot</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.abbyy">Abbyy</span>

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending the form, you agree to Personal Policy and Service Conditions

Toto Image

Ask questions if you want to discuss a theory or an exercise. Hexlet Support Team and experienced community members can help find answers and solve a problem.