A little learning. A little more confidence.Your next step starts here

Lesson 2 of 6 · About 6 minutes

Files, folders, and paths

Learn the concept.

A path tells a tool where to look. Knowing where you are prevents the easy mistake of inspecting the wrong file with the right name.

SEE THE IDEA

Read a path from left to right

Example absolute path: /home/learner/cases/brief.txt.

  1. Root
    /

    The starting point of this file-system tree.

  2. Directories
    home → learner → cases

    Each component narrows the location.

  3. File
    brief.txt

    The particular file inside cases.

Check the working directory, then read the path from the right starting point.
Read the visualFrom /home/learner, what does cd cases change?

cd changes the shell’s working directory. It does not edit, rename, or transfer ownership of the files.

Start from your location

A working directory is the folder a command starts from. In the practice terminal, pwd displays it and ls lists its contents.

Read the route

An absolute Linux path starts at /, such as /home/learner/cases. A relative path starts from the current directory. The .. component means the parent directory.

Navigate without changing the evidence

cd changes your working directory. It does not move files. File names can be case-sensitive, so cases and Cases may refer to different things.

Put it in context

You are in /home/learner. The command cd cases takes you into /home/learner/cases. From there, cat brief.txt reads that folder’s brief. A file called brief.txt elsewhere would be a different file.

Make a decision.

Explore the practice space, then answer the check-in below. A correct answer lets you save this lesson to your progress.

YOUR PRACTICE SPACE

Try the idea for yourself.

Enable JavaScript to explore this fictional exercise. The explanation and visual above remain available.

Take this with you.

Check the working directory, then read the path from the right starting point.

Read the original sources
YOUR LEARNING SPACE