The Command Line · practice
Command-Line Checkpoint
A request arrives: here is a source folder, here is where things go once they are reviewed, and here is one reference file that must come through untouched.
This is where separate commands become a procedure. Orient, inspect, change one exact target, verify. You already know every command you need, and nothing new is introduced here.
Starting conditions
Graded from the workspace. Use Reset first if an earlier attempt left checkpoint/reviewed behind. The checkpoint subtree starts like this:
/workspace/checkpoint
├── inbox
│ ├── brief.txt
│ └── draft.txt
└── reference
└── keep.txt
with these contents:
inbox/brief.txt: Check the source before you copy it.
inbox/draft.txt: Rename this draft when you move it.
reference/keep.txt: This reference file must not change.
Open the /workspace. If you are not, move there before starting.
Your task
1. Orient and inspect
List checkpoint and preview its two supplied directories. Move into it, confirm you arrived at /workspace/checkpoint, then confirm inbox/brief.txt is a file and read its contents.
Now run this on purpose and read the error carefully:
Get-Content -LiteralPath ./inbox/missing.txt
cat ./inbox/missing.txt
cat ./inbox/missing.txt
That failure is part of the exercise. Notice what it tells you: the
2. Build the reviewed output
Recover by listing inbox and using the brief.txt that is actually there. Create reviewed, copy inbox/brief.txt to reviewed/brief.txt, and preserve the source. Copy inbox/draft.txt into the reviewed folder, then rename that copy to final.txt. Leave both inbox files in place.
3. Remove one disposable target
Create an empty reviewed/remove-me.tmp, see it in a listing, preview its removal where your shell supports that, then remove that exact file.
4. Record and verify completion
Write the single word complete to reviewed/status.txt. This is a plain completion receipt; the previous lesson already demonstrated environment inheritance with its supplied child program. List the reviewed folder and read the three result files before submitting.
Constraints and required final state
Work only below /workspace/checkpoint. Name one target at a time rather than matching several at once, and use no options that widen or force an operation. Do not alter or remove reference/keep.txt, inbox/brief.txt, or inbox/draft.txt.
That failed read in step 1 is diagnostic practice. Do not create missing.txt to make the message go away. Making an error disappear is not the same as understanding it, and the troubleshooting chapter depends on the difference.
Your final tree must satisfy all of this:
inbox/brief.txtandinbox/draft.txtboth still exist with their original lines.reviewed/brief.txtmatchesinbox/brief.txt.reviewed/final.txtholds the original content ofinbox/draft.txt; the intermediatereviewed/draft.txtno longer exists.reviewed/status.txtcontains exactly the completion receiptcomplete.inbox/missing.txtstill does not exist; the deliberate failure was evidence, not an instruction to create it.reviewed/remove-me.tmpdoes not exist.reference/keep.txtstill readsThis reference file must not change.
Verify it yourself before submitting: list reviewed, then read each of the four files named above. The listing must show brief.txt, final.txt, and status.txt, and no temporary file. The contents must be:
Check the source before you copy it.
Rename this draft when you move it.
complete
This reference file must not change.
Leave that state and press Check my work.
Reading ./inbox/missing.txt reports that it cannot find the path. What is the best first response?
The check reads your final tree rather than your command history, and that is deliberate. Nobody inheriting this folder cares which keystrokes produced it. They care that the reviewed files are there, the originals survived, and the reference is untouched.
You have finished the