Skip to content
Clairos Learn

Files and paths · Lesson 31 of 36 · 8 minutes

Temporary workspaces

Create bounded temporary files and directories for disposable work.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Using temporary paths instead of cluttering durable locations helps operators explain what they know before they change anything.

mktemp
Create a uniquely named scratch location in the virtual filesystem.

Do not guess a temporary filename when isolation matters.

ls
List directory entries; -a includes hidden names and -l adds ownership and permission detail.

A listing is not proof that you can read or modify every listed file.

Worked example and expected result
$ mktemp lab/note.XXXXXX
/home/learner/lab/note.000001

Exit status: 0. The command completed successfully in the training fixture.

$ mktemp -d lab/work.XXXXXX
/home/learner/lab/work.000001

Exit status: 0. The command completed successfully in the training fixture.

$ ls -la lab
--rw------- learner learners     0 note.000001
ddrwxr-xr-x learner learners   dir work.000001

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Temporary workspaces”, which interpretation is safe?

Apply it elsewhere

Before adapting the mktemp workflow from “Temporary workspaces” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Sorted inventory comparisonTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Canonical path reviewTurn relative and linked paths into stable absolute locations.Practice
  2. 02Sorted inventory comparisonCompare two sorted account inventories without modifying either file.Practice
  3. 03Restore copy verificationCopy a restore candidate and compare it with its source.Practice