Keep the useful bits, human.
Beginner field notes
- The working directory is the folder used as the starting point for ordinary relative paths in the current shell environment.
- In the illustrated POSIX-style shell, pwd prints an absolute pathname for the current working directory.
- If notes is an existing subfolder, cd ./notes asks the current shell to enter it. It does not move that folder somewhere else.
See a worked example
Change the base for relative paths
One reviewed sample, shared across levels. Nothing here runs on your computer.
Example review recorded 2026-10-07 · version 1.
pwd
cd ./notes
pwd/home/learner/human-lab
/home/learner/human-lab/notesIllustrative 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.
Sources for this sampleWhere does this instruction go?
A Terminal window can show a shell or run Claude Code. Check which program is ready for your input; the window’s name or a single prompt symbol is not enough.
- Ask your coding assistant
- A plain-language request goes in the assistant’s conversation. It can run a command only if that tool and your permission are available.
- Claude Code command
- A Claude Code slash command, such as
/plugin, belongs at the Claude Code prompt. It is not a shell command or a command for every chat website. - Computer terminal · shell prompt
- A shell command belongs in a shell, such as zsh or Bash. On a Mac, use Terminal or an editor’s integrated terminal with a shell ready for input.
Copying does not run anything. Read the instruction’s purpose and destination before entering it. Example output is a result to read, not another command.
Try one read-only step: find the current folder
Choose one route. You do not need to install HWTL or make an account to read these steps.
In this project, use a read-only shell command to show your current working folder and explain the result. Do not change files. If you cannot run a command, tell me. Or, at a Unix-style shell prompt on macOS or Linux:
pwd After entering pwd, press Enter and read the path it prints. Your path will differ from the sample lesson. In PowerShell, use Get-Location instead.
Separate terminal tabs and the assistant’s command tools may use different working folders. Check the location in the session where the next command will run; do not assume they match. A plain chat without command tools can explain the step, but cannot run it for you.
Visual
The reviewed description and complete diagram source are available here.
More of this diagram is available inside its frame. Focus the frame and use the arrow keys to pan.
Read the complete diagram source
This is the source for the reviewed diagram, not a command to run.
flowchart LR
A["Working directory: human-lab"] -->|"cd ./notes"| B["Working directory: human-lab/notes"] Full explanation and primary sources
Reviewed explanation
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.
Source collection
- POSIX.1-2024: cd
Used in: Quick notes · Worked example · Lesson text
Current-shell directory changes, relative operands, CDPATH, logical/physical modes, unsuccessful changes, separate environments and the -P/-e exit-status exception.
cd changes the current shell execution environment’s working directory; relative-path resolution and failure behavior are specified.
- POSIX.1-2024: pwd
Used in: Quick notes · Worked example · Lesson text
Reports an absolute working-directory pathname and defines -L/-P logical/physical behavior.
pwd reports the current working directory, with logical/physical path distinctions beyond this simple no-symlink example.
Notes AI source review · 2026-10-17
AI source comparison recorded 2026-10-07. Human learner validation is pending.
Quick quiz · one question
Track the working directory through a failed change
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?
Why this answer?
Answers stay on this device.
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. AI comparison against primary documentation recorded on 2026-10-08; the references above state their scope. Human learner validation has not been run. A result here records this attempt; it does not establish mastery.
Follow this learning pathLesson 7 of 8
From project files to a small program
Save or adjust this lesson
Make this lesson yours
Save it for later, or tell your robot what would help.
This correction stays on this browser. Browse all concepts if the topic is missing.
Familiarity is your own assessment. To use it in your coding tool, download your updated learning profile.
Familiarity and lesson feedback are saved on this browser. They do not sync to your account or coding tool.