Skip to content
Atlas, your robot learning host

Interim portrait

Atlas · Foundations working-directory

Hello, little human. I am Atlas. One useful idea is plenty for a beginning. Read the explanation, then explore an example.

Choose your robot No recording yet · text complete

Watch · salvaged hardware

Reviewed videos and Shorts

Captions requested · no autoplay

Checking the reviewed learning library…

Videos · 16:9

Awaiting a reviewed signal

Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned

Shorts · 9:16

Awaiting a reviewed signal

Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
Awaiting reviewNo video assigned
    concept for everyone

    Working Directory

    The working directory is the location a shell uses when resolving ordinary relative file paths.

    Understand the idea

    A shell session has a working directory. It is the starting point for ordinary relative path arguments in the examples here. Opening another terminal tab can give you a different session with a different working directory, so check the current location instead of assuming it matches another tab.

    In the simple POSIX-shell example, cd ./notes changes the shell’s working directory to an existing notes subfolder. The ./ prefix explicitly starts from the current directory. It changes the shell’s location; it is not a command to move the folder or delete its contents. pwd shows the resulting location.

    The example assumes a human-lab folder with a notes subfolder already inside it. If the target folder does not exist or is inaccessible, cd can fail; the example does not create it for you. Before running a script by filename, check that you are in the folder containing it or supply the appropriate path.

    Key points

    • 01 The working directory belongs to the current shell session.
    • 02 Ordinary relative paths are interpreted from that location.
    • 03 pwd shows the current location in the illustrated POSIX shell.
    • 04 cd ./notes selects an existing notes subfolder relative to the current folder.
    • 05 A failed directory change is different from successfully entering a folder.

    Worked example

    Change the base for relative paths

    A worked example using sample data. Nothing here runs on your computer.

    Example
    pwd
    cd ./notes
    pwd
    What it means or produces
    /home/learner/human-lab
    /home/learner/human-lab/notes

    Illustrative POSIX-shell output. The notes folder must already exist beneath the initial human-lab folder. cd normally produces no output here; the two displayed paths come from the two pwd commands.

    Visual

    Follow the primary sources

    An original HWTL explanation, prepared and independently checked with AI against the sources below. This lesson has not yet been tested with human learners.

    Source review completed 2026-10-07.

    • POSIX.1-2024: cd

      cd changes the current shell execution environment’s working directory; relative-path resolution and failure behavior are specified.

    • POSIX.1-2024: pwd

      pwd reports the current working directory, with logical/physical path distinctions beyond this simple no-symlink example.

    Practice · predict the result

    Track the working directory through a failed change

    A small test from your robot instructors. Hints are welcome.

    What you will practice: Predict how a successful directory change alters a relative-path base, and how a failed change leaves that base unchanged.

    Sample scenario. Synthetic POSIX shell. Only the listed folders exist and are accessible; no symbolic links or CDPATH lookup apply. Steps continue after the failed cd. Predict stdout from pwd only; the failed cd has a diagnostic whose exact wording is outside this model.

    Initial working directory
    /human-lab
    Existing accessible folder
    /human-lab
    Existing accessible folder
    /human-lab/notes
    Step 1
    cd ./notes
    Step 2
    pwd
    Step 3
    cd ./missing
    Step 4
    pwd
    Resolve after the steps
    plan.txt

    Follow the four steps. What is the final working directory, where does plan.txt point, and what are the two pwd output lines?

    Attempts stay on this browser and are kept separate from lesson views and your self-reported knowledge.

    Sources and exercise scope
    • POSIX.1-2024: cd

      cd changes the current shell working directory; an unsuccessful change leaves that directory unchanged.

    • POSIX.1-2024: pwd

      Plain pwd reports the current working directory as an absolute path, followed by a newline.

    Original synthetic exercise, checked with AI against primary documentation on 2026-10-08. Human learner validation is pending. A result here records this attempt; it does not establish mastery.

    Next useful step

    Keep the useful idea. Return when you need it.

    Open your learning inboxExplore another concept →
    Lesson diagnostics

    Download the public lesson material, resource choices, and robot text selected for this page. The file does not include your chat, code, or saved profile. Nothing from the trace is uploaded.

    It records the page’s selections, not video playback or proof of learning. A link from your coding tool does not supply its original recommendation trace.

    Enable JavaScript to create a trace on this device.

    Related concepts

    See also

    IAM Role, File Paths, Terminal, RUN Program, Webhook, Files AND Folders, Oauth Scope

    Discussion

    Comments are powered by Giscus on the project's GitHub Discussions. They'll activate once we enable Discussions on the repo.

    Until then, file an issue with feedback.