Skip to content
Clairos Learn

Files and paths · Lesson 27 of 36 · 8 minutes

Glob safety preview

List and find targets before deleting broad patterns.

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

Junior operators build confidence by gathering evidence before changing systems.

find
Search directory trees by criteria rather than relying on one shallow listing.

Quote wildcard patterns so find receives them instead of the shell expanding them first.

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.

rm
Remove the named file from the virtual workspace. The training root and system trees are guarded.

Simulator protections are not a promise that a real shell will protect the same target.

Worked example and expected result
$ find /home/learner/lab -name txt
(no output; exit 0)

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

$ ls lab
(no output; exit 0)

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

$ rm lab/*
Wildcard deletion is not simulated. Name one lab file directly.

Exit status: 1. This nonzero result is an expected part of this exercise.

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 “Glob safety preview”, which interpretation is safe?

Apply it elsewhere

Before adapting the ls workflow from “Glob safety preview” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Temp cleanup reviewTry 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. 01Symlink inventoryCreate, read, and inspect links before relying on them.Practice
  2. 02Temp cleanup reviewInspect temporary paths before cleanup decisions.Practice
  3. 03File type inspectionIdentify files, directories, links, and text before acting on them.Practice